CSS Properties

Width and Height Properties

Width

This property is used to set the width of an element. We can set this property to auto and length in the form of px, cm, % etc.

Exxample:

div {
width: 100px;
}


Height

This property is used to set the height of an element. We can set this property to auto and length in the form of px, cm, % etc.

Example:

div {
height: 100px;
}
Cristle Academy

Compiler