Skip to Content
CSS in Depth
book

CSS in Depth

by Keith Grant
March 2018
Intermediate to advanced content levelIntermediate to advanced
472 pages
13h 5m
English
Manning Publications
Content preview from CSS in Depth

Chapter 3. Mastering the box model

This chapter covers

  • Practical advice for element sizing
  • Vertical centering
  • Columns of equal height
  • Negative margins and margin collapsing
  • Consistent spacing of components on the page

When it comes to laying out elements on the page, you’ll find a lot of things going on. On a complex site, you may have floats, absolutely positioned elements, and other elements of various sizes. You may also have some layouts using newer CSS constructs, such as a flexbox or a grid layout. You have a lot of things to keep track of, and learning everything involved with layout can be overwhelming.

We’ll spend several chapters taking a close look at several layout techniques. Before we get to those, it’s important to have a solid ...

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

CSS: The Definitive Guide, 4th Edition

CSS: The Definitive Guide, 4th Edition

Eric Meyer, Estelle Weyl
Tailwind CSS

Tailwind CSS

Ivaylo Gerchev

Publisher Resources

ISBN: 9781617293450Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link