Divs by default take up the entire span of the browser window. I just want it to take up the width of the contained content. What’s the best way to do this. I’ve seen using display:table, but it doesn’t work in IE7.
When using display:table it will treat width as if it were min-width, basic table behavior. By doing that any other block level children with width:auto; (such as a <p> tag) will not force the parent to fill the viewports available space. If there is a block child with a defined width greater than the parent’s width it will expand to accommodate it. (kinda like IE6 does)