Describe the following common CSS units of length: cm, em, in, mm, pc, pt, and px.
Experience Level: Junior
Tags: CSS
Answer
- cm - centimeters
- em - font size of the element
- in - inches is 2,54 cm
- mm - milimeters
- pc - pica: A pica is a hair less than 1/6 inch, and contains 12 points. Picas are typically used to represent fixed horizontal measurements, most often column width.
- pt - point: Points are the measurement most commonly used in print to indicate the size of type, as well as the space between lines.
- px - pixels
Related CSS job interview questions
How do you set border on an element?
CSS JuniorWhat are CSS vendor prefixes?
CSS JuniorGive an example of how you would use counter-increment and counter-reset in CSS to create automatic numbering within a webpage?
CSS MediorWhat is a CSS preprocessor?
CSS MediorWhat are CSS media queries? And what are they use for?
CSS Junior