Prev | Current Page 288 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"

142).
An element to which min-width is
applied will never be narrower than the
minimum width specified, but it will
be allowed to grow normally if its
content exceeds the minimum width set.
Example
This style rule assigns a minimum width
of 100 pixels to paragraphs within the
element with ID "example":
#example p {
min-width: 100px;
}
min-width is often used in conjunction with max-width to produce a width range
for the element concerned.
SPEC
version initial inherited
CSS2 0 NO
BROWSER SUPPORT
Op9.2+ Saf2+ FF1+ IE7+
FULL FULL FULL FULL
Combining min-width and width
It should be noted that min-width and width values should not be applied to the
same element if they use the same unit, as one will override the other. For example,
if the width is set to 150px and the min-width is set to 60px, the actual width of the
element is 150px, and the min-width declaration becomes redundant:
#example {
min-width: 60px;
width: 150px;
}
In the above example, the width of the element will be fixed at 150px.


Pages:
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300