Monday, 12 August 2013

Stretch/Shrink parent div to fit content's width

Stretch/Shrink parent div to fit content's width

I am trying trying to make a div's width as wide as it's content. Here's a
fidle to show what I mean:
http://jsfiddle.net/djxpU/
I want the blue area to be as wide as the white. I tried float:left and
display:inline-block, however they won't work with position:absolute;. Any
workarounds?

No comments:

Post a Comment