In this tutorial we will learn about CSS Measurement Units.CSS Measurement units are used to mention the size of HTML elements in the web page like to mention text size of paragraph element or height and width of image elements. CSS support number of measurement units. Please check the list of various Measurement units below.
List of available measurement units in CSS:
Unit | Description | Example |
---|---|---|
% | Use define element measurement in % | heigth:50% |
cm | Use to define element measurement in Centimeters | height:10cm |
px | Use to define element measurement in pixels | height:50px |
em | Use to define relative measurement for the height of a font in em spaces | height:15em |
ex | Use to defines a measurement relative to a font’s x-height. | height:10ex |
in | Use to define element in measurement in inches. | height:1in |
mm | Use to define element measurement in millimeters | height:50mm |

Parvesh Sandila is a passionate web and Mobile app developer from Jalandhar, Punjab, who has over six years of experience. Holding a Master’s degree in Computer Applications (2017), he has also mentored over 100 students in coding. In 2019, Parvesh founded Owlbuddy.com, a platform that provides free, high-quality programming tutorials in languages like Java, Python, Kotlin, PHP, and Android. His mission is to make tech education accessible to all aspiring developers.​