Sent by Zoe M. Gillenwater on 4 November 2004 20:08
Fabien Meghazi wrote:
>A div takes all the space that it can afford.
>How can I tell a div that it should only take the space that it's
>inner elements are using ?
>
>
This is usually referred to as "shrinkwrapping". It can be accomplished
in a variety of ways, but not all browsers support all the ways.
1. change it to display: inline
2. change it to display: inline-block (does work in IE but only on
naturally inline elements like span, doesn't work in Gecko)
3. change it to display: table-cell (doesn't work in IE)
4. float it (doesn't work in MacIE unless you also give it display:
inline-block or float its contents as well)
Zoe
--
Zoe M. Gillenwater
Design Specialist
Highway Safety Research Center
http://www.hsrc.unc.edu
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/