Files
freeCodeCamp/guide/english/css/properties/width-property/index.md
S.Hale 3920b7c4ce Corrected capitalization, corrected to American spellings and typos (#30685)
* Translate challenge subtitles and example challenge text to Spanish

* Corrected errors in syntax and punctuation

* Multiple corrections of it/s to its plus other grammar corrections

* Correction and added paragraph to CSS Flex article

* Corrected my own typo

* Corrected capitalization, American spellings and typos
2018-11-07 10:34:13 -05:00

906 B

title
title
Width Property

Width Property

The width property sets the width of an element. It can be a keyword value, a length value (any value followed by a CSS unit like px or em), percentage, or it can be inherited by its parent. By default, its value is auto.

Note: The width property does not include padding, borders, or margins; it sets the width of the area inside the padding, border, and margin of the element!

    .length-value {width: 100px;}
    .percentage {width: 50%;}
    .auto {width: auto;}
    .inherit {width: inherit;}
    .initial {width: initial;}

Note: The min-width and max-width properties override width.

More Information:

Docs: MDN

Browser Support: It's categorised under the 'well supported sub-set', so need not worry for browser support