- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Working with CSS Units
CSS has several units for different units such as width, margin, padding, font-size, border-width, etc. The length indicates by using numerical value followed by length units such as px, dp, em, etc. It does not allow white spaces in between numerical values and length units.
Length units divided as follows:
- relative units
- absolute
Absolute units
Units | Abbreviation |
---|---|
Pixels | Px |
Points | Pt |
Inches | In |
Centimeters | Cm |
Picas | Pc |
Relative Units
In relative units, the length value is fixed and it appears the exact size of the element
Units | Abbreviation |
---|---|
Percent | % |
Em | Em |
Ex | Ex |
Root em | Rem |
Viewport width | Vw |
Viewport width | Vh |
Viewport width | Vm |
Character | Ch |
Grid | Gd |
- Related Articles
- Working with Inline CSS
- Working with element for CSS
- Working with CSS Display Property
- Working with CSS Overflow Property
- Working with CSS Pseudo Classes
- Display Inline Working with CSS
- Text Indentation Working with CSS
- Word Spacing Working with CSS
- Styling Links Working with CSS
- Text Transformation Working with CSS
- Styling Tables Working with CSS
- CSS Measurement Units
- CSS Relative units
- CSS Absolute Units
- Understanding CSS Units

Advertisements