O'Reilly logo

Cascading Style Sheets: Designing for the Web, Third Edition by Bert Bos, Håkon Wium Lie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. The Amazing Em Unit and Other Best Practices

This chapter is about writing style sheets with style. By showing you case studies and how they are constructed, we give you a sense of how CSS can encode the visual presentation you want to achieve. More importantly, if you follow the guidelines in this chapter, your documents will behave well on a wide range of Web devices. For example, they will scale gracefully from one screen size to another.

Use ems to make scalable style sheets!

The foremost tool for writing scalable style sheets is the em unit, and it therefore goes on top of the list of guidelines that we compile throughout this chapter: Use ems to make scalable style sheets. Named after the letter “M,” the em unit has a long-standing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required