How can I make a div not larger than its contents?

前端 未结 30 3669
青春惊慌失措
青春惊慌失措 2020-11-21 07:35

I have a layout similar to:

I would like for the div to only exp

30条回答
  •  南方客
    南方客 (楼主)
    2020-11-21 07:55

    Try display: inline-block;. For it to be cross browser compatible please use the below css code.

    div {
      display: inline-block;
      display:-moz-inline-stack;
      zoom:1;
      *display:inline;
      border-style: solid;
      border-color: #0000ff;
    }
    Column1 Column2 Column3

提交回复
热议问题