CSS Height & Width (All Properties)

Please Share On:

Defination:

CSS height and width properties are used to assign the height and width of an element. This property sets the height and width inside the padding of an element.

Height & Width Properties:

Height & Width PropertiesDescription
heightheight property is used to set an element’s height.
widthwidth property is used to set an element’s width.
min-heightmin-height property is used to assign the minimum height of an element.
max-heightmax-height property is used to assign the maximum height of an element.
min-widthmin-width property is used to assign the minimum width of an element.
max-widthmax-width property is used to assign the maximum width of an element.

CSS Height and Width Values

height & width valueDescription
autoThe browser auto calculates the height and width of an element.
lengthIt used to assign the value in millimeters(mm), centimeters(cm), pixels(px), inches(in), points(pt) and so on.
percentage (%)It used to set the height and width property values in percentage.
initialSet the height and width value to its default value.
inheritInherit its height and width value to its parent value.

Donate to support writers


You may be interested in the following topics:

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright @2023. All Right Reserved.


Social media & sharing icons powered by UltimatelySocial