Jump to ratings and reviews
Rate this book

CSS in Depth, Second Edition

Rate this book
To create web designs that delight, entertain, and impress your users, you need to know CSS in depth!

Getting good—really good—at CSS means learning everything that CSS is capable of. This totally revised new edition of CSS in Depth expands your CSS skills with the patterns, layouts, and methods you need to deliver truly beautiful front ends.

In CSS in Depth, Second Edition you will learn how

• Create a web page with layout methods
• Develop essential website components, like dropdown menus and dialog boxes
• Make your website fully responsive across devices
• Organize your CSS for easy future maintenance
• Implement designer mockups with attention to detail
• Use animations to guide user focus
• Avoid common CSS pitfalls

The more you know about CSS, the more confident you’ll be at tackling any tricky website design! CSS in Depth has given thousands of web developers the tools and the inspiration to make sites that really pop. This second edition is packed with the latest best practices, new CSS language features, and essential advice on how to organize and maintain your CSS codebase.

Foreword by Chris Coyier.

About the technology

To deliver truly beautiful frontends, you need to know CSS inside and out. And as CSS grows and matures, even experienced CSS developers will find a whole new set of skills to catch up on! This guide will help you discover everything that CSS is capable of—from the must-knows and brand-new features to the hidden insights you won’t find anywhere else!

About the book

CSS in Depth, Second Edition, deep dives into the CSS techniques used by the world’s most skilled web developers. Inside, you’ll learn how to build and organize a modular CSS codebase that’s easy to understand, maintain, and reuse. This new edition is fully revised to cover the CSS standard’s latest additions, including cascade layers, logical properties, new color functions, subgrid, and container queries.

What's inside

• Vertical centering, margin collapsing, and positioning
• Dropdown menus and modal dialog boxes
• Animations to guide user focus
• Avoiding common CSS pitfalls

About the reader

Written for web developers who know the basics of CSS and HTML.

About the author

Keith J. Grant is a Principal Software Engineer at Red Hat, where he works on front-end code for the Ansible Controller web application using JavaScript and CSS.

The technical editor on this book was Chris Chinchilla.

Table of Contents

PART 1
1 Cascade, specificity, and inheritance
2 Working with relative units
3 Document flow and the box model
PART 2
4 Flexbox
5 Grid layout
6 Positioning and stacking contexts
7 Responsive design
PART 3
8 Cascade layers and nesting
9 Modular CSS and scope
10 Container queries
PART 4
11 Color and contrast
12 Typography and spacing
13 Gradients, shadows, and blend modes
14 Masks, shapes, and clipping
PART 5
1

544 pages, Paperback

Published September 3, 2024

8 people are currently reading
13 people want to read

About the author

Keith J. Grant

2 books8 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
2 (66%)
4 stars
1 (33%)
3 stars
0 (0%)
2 stars
0 (0%)
1 star
0 (0%)
Displaying 1 - 2 of 2 reviews
Profile Image for Iain Davis.
14 reviews1 follower
July 25, 2025
`TL;DR
Highly recommended for its broad coverage of the CSS language, as well as its coverage of new and emerging CSS topics. The engaging practical exercises made it a consistently enjoyable read, as well as being informative and valuable.



My career more or less started working in back-ends. I was a Java-first engineer when I started out, and only occasionally had reason to fix a bug or something on the front end. So when I transferred to Sydney and started working in JavaScript, TypeScript and React a lot more, I just kind of picked up things as I needed them. I was working with JavaScript a lot, so I had many opportunities to learn there, and when we picked up a TypeScript project, the same was true. But I still had very little interaction with CSS — enough to do the work that came my way and design some components, but not really enough to claim to "know" CSS. I'm someone who likes to know their tools. I figured it would be wise, in the few weeks I have before I return to work, if I committed some time to getting to know the language a little bit better.

I chose Manning's CSS In Depth by Keith J. Grant. I found this book to be really valuable. It's well-organized and easy to follow. It features a steady stream of practical examples that demonstrate various CSS features and keep the pace engaging (and maybe even fun?).

The book covers a lot of ground, in roughly four sections:

The first section covers CSS basics. This is mostly material I knew, but some things were clarified for me here, particularly in understanding how conflicts between selectors get resolved. It also highlighted some gotchas working with shorthand notations that I didn't know about.

The next section covers layout. This is where I expected to find the most value, and I did find a lot of value here. I feel much more confident working with flexbox. I feel I can hold my own working with grid. And position (fixed, absolute, relative, etc.) is much clearer to me. There was also a good discussion of responsive design that put some new tricks in my toolbelt (auto-scaling fonts with min/max sizes are pretty cool).

Part 3 is the part I didn't know I needed. A lot of this covers how the CSS standard is evolving to embrace features originally introduced by CSS preprocessors. CSS layers give you another mechanism for controlling how the cascade resolves a conflict between selectors. Container queries let you scale responsive elements according to their container size, rather than the size of the entire viewport. Scopes might be my favorite: they give you much the same advantages of the BEM convention, limiting your styles to where you want them to go. But they also allow you to specify a lower bound beyond which your styles will not apply. So if you're defining a module meant to contain modules, you no longer have to be quite so careful about how your selectors apply within that scope. It's pretty cool, and it was fun to read about and use.

Part 4, in the author's estimation, is the "fun" part. I'm not sure I agree. It covers the elements that will please folks a little farther towards "designer" on the "designer/engineer" spectrum than I am. Still, it's good to know about some of the color, typography, and mask/clipping features that I didn't really know much about before. And the discussion on the newly supported wider color spaces was pretty interesting.

Nearly last, Part 5 covers motion (and by association transforms). This also felt a bit more on the "designer" side of things for me, but certainly I can see the value of using motion to communicate with the user in an intuitive way. And it's good to know the performance benefits of using transforms over position properties (and, at a high level, why they perform better).

Last come two appendices: one that discusses selectors, and another that summarizes CSS preprocessors and compares two leading implementations. I was a bit surprised to find the discussion of something as fundamental to CSS selectors relegated to the appendices, and not right up-front in the "basics" section, but I can kind of see why he did it that way. They don't really require much explanation and a list of selectors and selector components, coupled with their regular use throughout the book, seems an adequate exposure to the topic.

Having read this book, I do not necessarily feel I'm a CSS expert. But I do feel armed with the knowledge I need to tackle projects that will help me to become one. I feel much more prepared to engage with CSS. I feel like I could recognize some not-very-good CSS and refactor it into something better, rather than just timidly adding my changes to it while trying not to break anything. What's more, the book was pleasant to read, and I found myself multiple times doing that "just one more chapter" thing that I used to do with novels, when I still read novels.

If you're a CSS novice, or you just want to get exposed to some of the new features, you could certainly do worse than this book. I do recommend it.`
Profile Image for Peter Zuo.
5 reviews
May 8, 2025
no big difference from the first edition, added
1. chapter 8: cascade layers and nesting
2. chapter 10: container queries
3. chapter 14: masks, shapes, and clipping

some of these features are not supported by all browsers, as the time of now(May 2025), so you may not need to read this book if you don't intend to use this features and have finished the first edition
Displaying 1 - 2 of 2 reviews

Can't find what you're looking for?

Get help and learn more about the design.