What is the difference between using em and rem units for font-sizing in CSS?
- 'em' is always relative to the root element's font size
- 'em' is fixed and not dependent on any parent's font size
- 'em' is relative to the font-size of the nearest parent or the element itself. 'rem' is relative to the root element's font size.
- 'rem' is relative to the font-size of the nearest parent or the element itself.
The key difference is in the reference point. 'em' is relative to the nearest parent's font size, while 'rem' is relative to the root element's font size. Understanding this distinction is essential for consistent and scalable typography in CSS.
Loading...
Related Quiz
- In SASS, ________ is a powerful feature that allows styles to be applied based on a set of conditions.
- What is the main advantage of using a CSS framework like Bootstrap in web development?
- In Flexbox, which property is used to align items vertically in the container?
- What does the ::before pseudo-element do in CSS?
- The ________ property in CSS is used to specify the vertical alignment of inline or table-cell elements.