← Back to Glossary

width

Box Model

Sets the horizontal width dimension of block or inline-block elements.

Common Value Formats

  • width: 300px; Static pixels
  • width: 50%; Half of parent container bounds
  • width: auto; Default browser calculation
interactive-example.html
Live Preview