CSS Height and Width

CSS Height and Width


CSS Height-Width
CSS height and width properties are used to set the height and width of an element - 
In CSS, The height and width properties do not include padding, borders, or margins. 
It is used to set the height and width of an element inside the border, padding, and margin of the element.
Height and width property can have the following values - 
  • auto - In this value, the browser will calculate the height and width of the element.
  • length - Defines the height and width in px,etc.
  • % - Defines the height and width in percent of the bigger body, or body of the parent element.
  • initial - Sets the height and width to its default value
  • inherit - It will inherit the height and width of the child value.
Now we will see Example - 
Example - 
Output - 
Example2 - 
Output -