Previous Message
Next Message

Auto-Sizing a div or span tag

Sent by Philippe Wittenbergh on 6 January 2008 09:09


On Jan 6, 2008, at 12:35 AM, Bruno Fassino wrote:

>> With a long caption, the text does not wrap to the width of the
>> image, but that is expected.
>
> Yes. To always get a "fit" to the width of the image (or to a wider
> unbreakable word, if any) there is:
>
> width: -moz-min-content;

Good point.
Technically, all these values (-moz-max-content, -moz-min-content, - 
moz-available, -moz-fit-content) can also be used for min-/max-width.
This can be useful in e.g. the case where a box is sized with 'width:  
xxem' and contains an image. If the user has set his font-size to  
something small, the image might overflow the box, resulting in an  
ugly look. 'min-width: -moz-min-content' can alleviate this.

from
<http://developer.mozilla.org/en/docs/CSS:width>
# -moz-max-content : the intrinsic preferred width
# -moz-min-content : the intrinsic minimum width
# -moz-available : the containing block width minus horizontal  
margin, border, and padding
# -moz-fit-content : the same as -moz-max-content

Philippe
---
Philippe Wittenbergh
<http://emps.l-c-n.com>




______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: