There are mainly four different units in the CSS that are px, em, pt, and percentage (%).
- Px (Pixel) is used for fine-grained control and alignment and not cascade. To get it sharp, we can use 1px or multiple of px.
- Em is used to maintain relative size and responsive fonts. 1em = 16px having also the same font size. It is advisable to set the font size to 10px in common practice.
- Pt (point) is a fixed-size unit that is used in print. 1pt = 1/72 inch.
- Percentage (%) is used to set the font size with respect to the font size of the body. Thus, it is necessary to set the reasonable font size of the body.
Leave a Reply