CSS width property

Usage

Defines the width of an element.

Values

  • auto - the width of the element is automatically calculated
  • [length] - allows you to set a specific width for the element
  • [percentage] - specifies the element width as a percentage of the width of the containing element

Example

Code:

div {
  width: 400px;
}