From the course: Mastering Web Developer Interview Code

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

In CSS, what's the difference between ems and rems?

In CSS, what's the difference between ems and rems?

From the course: Mastering Web Developer Interview Code

In CSS, what's the difference between ems and rems?

- [Instructor] CSS has two units of measurements, Ems and rems, that have become really popular because of their flexibility especially when working with fonts. In this episode, we're going to take a look at how they work because they can trip you up as questions during a job interview. Now, pixels are the traditional way to size topography on the web, but in some older versions of IE, they are not resizable. And that presents an accessibility issue if someone doesn't have good eyesight and needs to make sure that the fonts are bigger on your page. now ems or rems are relative sizes which means that you can base the size of elements on other elements. One thing to remember is that every browser has a default font. Now, in most cases, that's 16 pixels but you can change that default to something else either in settings or in your own style sheet. And that affects how you use ems and rems. Once, you know your default…

Contents