CSS property: width

Description

Specifies the width of the content area, padding area or border area (depending on box-sizing) of certain boxes.

Syntax

width: <length> | <percentage> | auto;

Values

<length>
Specifies the width of the content area using a length unit.
<percentage>
Specifies a percentage width. The percentage is calculated with respect to the width of the generated box's containing block. If the containing block's width depends on this element's width, then the resulting layout is undefined in CSS3.
auto (by default)
The width depends on the values of other properties.

Versions

Examples

p {
    width: 100px;
}