O'Reilly logo

Stylin’ with CSS: A Designer’s Guide, Third Edition by Charles Wyke-Smith

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 2. How CSS Works

You saw in Chapter 1 how the structure of a document is created with HTML. In this chapter, I will show you how CSS rules are used to style HTML, and explain the workings of the Cascade, which is how CSS resolves which style is applied when more than one style affects an element property.

Each HTML element has style properties that can be set with CSS. These properties relate to the different visual aspects of the element, such as its position onscreen, the width of its border, the size, color, and fonts of its text, and so on. CSS is a mechanism for selecting HTML elements and then setting the selected elements’ CSS properties. Each CSS selection and the associated styles that are applied is called a CSS rule.

This ...

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