In the context of CSS accessibility, what is the significance of using relative units like 'em' or 'rem' instead of absolute units like 'px'?

  • font-size: 1.2em;
  • margin: 16px;
  • padding: 20px;
  • width: 300px;
Relative units, such as 'em' or 'rem', are crucial in CSS accessibility as they scale with the user's preferred font size. This ensures that the layout adapts to the user's settings, providing a more inclusive and user-friendly experience, unlike absolute units that may hinder accessibility.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *