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

前端 未结 30 3666
青春惊慌失措
青春惊慌失措 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:51

    this content inside the div being inside a table, needs no inline properties and the table is the one expanding to the content of this div =)

    I know people don't like tables sometimes, but I gotta tell you, I tried the css inline hacks, and they kinda worked in some divs but in others didn't, so, it was really just easier to enclose the expanding div in a table...and...it can have or not the inline property and still the table is the one that's gonna hold the total width of the content. =)

提交回复
热议问题