HTML and CSS Reference
In-Depth Information
#hatewidows {widows: 5;}
.widowmaker {widows: 1;}
CSS 2, 3
IE 8+
Netscape 6+, Firefox 1+
Opera 7+, Safari 1+
• This property is really only meaningful in a paged environment, such as print
• The default value should be 2 if unspecified.
• Negative values may not be used.
This property sets the width of an element's content region (excluding padding , border ,
and margin ).
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.
p {width: 400px; padding: 10px; border: solid 5px;}
#div1 {width: 80%; padding: 10px; border: solid 5px;}
CSS 1, 2, 3
IE 4+
Netscape 4+, Firefox 1+
Opera 4+, Safari 1+
• 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