Skip to Main Content
The CSS3 Anthology, 4th Edition
book

The CSS3 Anthology, 4th Edition

by Rachel Andrew
March 2012
Intermediate to advanced content levelIntermediate to advanced
400 pages
8h 55m
English
SitePoint
Content preview from The CSS3 Anthology, 4th Edition

Chapter 8 CSS Positioning Basics

In this chapter, we will look in further depth at some of the vital concepts when positioning page elements using CSS. If you’re reading this book chapter by chapter, you’ll already have come across some of these concepts used in the examples. Here we’ll take a proper look at them, and see how they can be used in combination to layout our pages and components.

How do I decide when to use a class and when to use an ID?

At first glance, classes and IDs seem to be used in much the same way: you can assign CSS properties to both classes and IDs, and apply them to change the way HTML elements look. But in which circumstances are classes and IDs best applied?

Solution

The most important rule where ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical CSS3: Develop and Design

Practical CSS3: Develop and Design

Chris Mills

Publisher Resources

ISBN: 9780987153029Errata