Cover Page by Charles Wyke-Smith

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

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 ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required