HTML and CSS Reference
In-Depth Information
Examples
#hatewidows {widows: 5;}
.widowmaker {widows: 1;}
Compatibility
CSS 2, 3
IE 8+
Netscape 6+, Firefox 1+
Opera 7+, Safari 1+
Notes
• This property is really only meaningful in a paged environment, such as print
output.
• The default value should be 2 if unspecified.
• Negative values may not be used.
width
This property sets the width of an element's content region (excluding padding , border ,
and margin ).
Syntax
width: length | percentage | auto | inherit
Standard positive length units can be used, and pixels ( px ) is often the assumed measurement
in browsers. Percentage values, based on the width of the containing element, can also be
used. The default value of auto automatically calculates the width of an element, based on
the width of the containing element and the size of the content.
Examples
p {width: 400px; padding: 10px; border: solid 5px;}
#div1 {width: 80%; padding: 10px; border: solid 5px;}
Compatibility
CSS 1, 2, 3
IE 4+
Netscape 4+, Firefox 1+
Opera 4+, Safari 1+
Notes
• The actual size of an object on a browser canvas is not solely defined by the width
property, as values for borders and padding affect the space taken. For example,
given the CSS rule here
#div1 {width: 200px; padding: 30px; border: solid 20px;}
Search WWH ::




Custom Search