O'Reilly logo

Cascading Style Sheets: The Definitive Guide by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

width — IE4 P/Y | IE5 P/Y | NN4 P/P | Op3 Q/-

Synopsis

Used to set the width of an element. This is most often applied to images, but can be used on any block-level or replaced element. Negative values are not permitted.

Example

TABLE {width: 80%;}

Values

<length> | <percentage> | auto

Default

auto

Inherited

no

Applies to

block-level and replaced

Percentage values refer to the parent element’s width.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required