
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Absolute Length Units in CSS
The absolute length units are fixed in relation to each other. These units are used when the output format is already known. Following are some of the Absolute Length Units −
Sr.No | Unit & Description |
---|---|
1 | cm centimeters |
2 | mm millimeters |
3 | in inches (1in = 96px = 2.54cm) |
4 | px *pixels (1px = 1/96th of 1in) |
5 | pt points (1pt = 1/72 of 1in) |
6 | pc picas (1pc = 12 pt) |
Example
<!DOCTYPE html> <html> <head> <style> .demo { text-decoration: overline underline; text-decoration-color: blue; font-size: 0.3in; } </style> </head> <body> <h1>Details</h1> <p class="demo">Examination Center near ABC College.</p> <p class="demo2">Exam begins at 9AM.</p> </body> </html>
Output
Example
Let us now see another example −
<!DOCTYPE html> <html> <head> <style> .demo { font-size: 1cm; } .demo2 { font-size: 5mm; } </style> </head> <body> <h1>ICC Rankings</h1> <p class="demo">ICC Test Rankings released 29th November.</p> <p class="demo2">ICC ODI Rankings released 30th November.</p> </body> </html>
Output
- Related Questions & Answers
- CSS Absolute Units
- CSS Absolute and Relative Units
- Understanding CSS Absolute and Relative Units
- Relative Length Units in CSS
- CSS Measurement Units
- CSS Relative units
- Understanding CSS Units
- Working with CSS Units
- CSS position: absolute;
- Absolute Positioning in CSS
- Absolute Positioning with CSS
- Absolute Positioning Using CSS
- Maximum absolute difference of the length of strings from two arrays in JavaScript
- Electrical Units and Metric Prefixes
- Absolute Deviation and Absolute Mean Deviation using NumPy
Advertisements