DEV Community

Oluwatobi Sofela
Oluwatobi Sofela

Posted on

CSS unit is my name

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 pxs (pixels).

div {
  width: 300px;
}
Enter fullscreen mode Exit fullscreen mode

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)