0% found this document useful (0 votes)
13 views7 pages

CSS Measurement 1697000454

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views7 pages

CSS Measurement 1697000454

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Measurement

Units in CSS

Tarak Shah
01

What are measurement


units in CSS?
CSS supports several measurement units.
These units are used to define lengths, sizes,
and distances for different elements within web
pages. @CODEWITHTARAK
In next slides you will learn about the most
commonly used CSS measurement units.

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

5. Viewport Percentage (vh, vw,


vmin, vmax)
These units are relative to the viewport's size.
VH represents a percentage of the viewport
height @CODEWITHTARAK
VW represents a percentage of the viewport
width.
VMIN represents the smaller of the two (width or
height).
VMAX represents the larger of the two (width or
height).

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!

Was this Like

post helpful
to you? Comment

follow for more! Share

Save

Tarak Shah
@CodeWithTarak

You might also like