CSS Measurement 1697000454
CSS Measurement 1697000454
Units in CSS
Tarak Shah
01
Tarak Shah
02
1. Pixels (px)
Pixels are the most commonly used unit in CSS.
They represent a fixed-size unit relative to the
screen or device pixels.
@CODEWITHTARAK
2. Percentage (%)
Percentages are relative units that represent a
proportion of another value.
For example, setting width: 50% means the
element's width will be 50% of its parent's width.
Tarak Shah
03
3. EM (em)
The EM unit is relative to the font size of the
element.
For example, if the font size of an element is set
to 16 pixels, 1em would be equal to 16 pixels.
@CODEWITHTARAK
4. REM (rem)
REM stands for "root em." It is similar to EM, but
it is relative to the root (HTML) element's font
size, rather than the parent element.
This makes REM useful for creating scalable
layouts.
Tarak Shah
04
Tarak Shah
05
6. Absolute Units
Centimeters (cm), Millimeters (mm), Inches (in),
Points (pt), Picas (pc) are absolute measurement
units. @CODEWITHTARAK
Their actual size can vary depending on the
output device and screen resolution.
Tarak Shah
I post about tech, web development and coding!
post helpful
to you? Comment
Save
Tarak Shah
@CodeWithTarak