Hi π
CSS Unit is my name. I am the standard of measurement used in CSS to express the size of an element's property.
For instance, the snippet below used me to define the size of the div
element's width
βwherein px
is the unit, and 300
is the number of px
s (pixels).
div {
width: 300px;
}
About my children
My children's names are relative and absolute length units.
Relative length unit is a dynamic standard of measurement.
You will often see her as a percentage (%
), element (em
), root element (rem
), or fraction (fr
).
Absolute length unit is a fixed standard of measurement.
You will often see him as pixels (px
), centimeters (cm
), millimeters(mm
), and inches (in
).
Visit CodeSweetly to find out more about us.
Top comments (0)