CSS Dimension


CSS Dimension : Its property allow to you control the height and width of the element. There are a number of CSS Dimension properties:

PropertyDescriptionValues
height
Set the height of an elementautolength,%, inhert
max-height
Set the maximum height of an element
nonelength,%, inhert
max-width
Set the maximum width of an element
nonelength,%, inhert
min-height
Set the minumum height of an element
length,%, inhert
min-width
Set the minumum width of an element
length,%, inhert
width
Set the width of an element
autolength,%, inhert

Example

header {
      max-width: 300px;
      height: 100px;
      background-color: red;
    }


  • auto The browser calculate the height and the width by default.
  • length Defines the height and the width by px, inch, cm,....
  • % Defines the height and the width by percentage.
  • inhert Set the height and the width will be inherited its parent value.




Leave a comment
No Cmomments yet