课程: Mastering Web Developer Interview Code

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

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

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

课程: 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…

内容