CSS

CSS Intro

CSS Intro Quiz

CSS Intro Exercise

CSS Basic

CSS Basic Quiz

CSS Basic Exercise

CSS Advance

CSS Advance Quiz

CSS Advance Exercise

CSS3

CSS3 Quiz

CSS3 Exercise

CSS Properties

CSS Functions

CSS Selectors

CSS width Property

CSS width Property

 

 

The width property is used to set the width of an element. It does not include padding, borders, or margins. The min-width and max-width properties override the width property.

 

Default Value:-

 

Its default value is auto.

 

Syntax:-

 

Its syntax is:- width: auto | value | initial | inherit;

 

Further Explanation:-

 

Value Description
auto The browser calculates the width
length Defines the width in px, em, etc.
% Defines the width in percent of the containing block
initial Sets this property to its default value.
inherit Inherits this property from its parent element.

Code Explanation

All Tutorials related to CSS Properties

All Sections related to CSS