Book Image

Mastering CSS Grid

By : Pascal Thormeier
4.3 (3)
Book Image

Mastering CSS Grid

4.3 (3)
By: Pascal Thormeier

Overview of this book

CSS Grid has revolutionized web design by filling a long-existing gap in creating real, dynamic grids on the web. This book will help you grasp these CSS Grid concepts in a step-by-step way, empowering you with the knowledge and skills needed to design beautiful and responsive grid-based layouts for your web projects. This book provides a comprehensive coverage of CSS Grid by taking you through both fundamental and advanced concepts with practical exercises. You'll learn how to create responsive layouts and discover best practices for incorporating grids into any design. As you advance, you'll explore the dynamic interplay between CSS Grid and flexbox, culminating in the development of a usable responsive web project as a reference for further improvement. You'll also see how frameworks utilize CSS Grid to construct reusable components and learn to rebuild and polyfill CSS Grid for browsers that don't fully support it yet. The concluding chapters include a quick reference and cheat sheet, making this book an indispensable resource for frontend developers of all skill levels. By the end of this book, you'll have thoroughly explored all aspects of CSS Grid and gained expert-level proficiency, enabling you to craft beautiful and functional layouts for web projects of any size.
Table of Contents (16 chapters)
Part 1–Working with CSS Grid
Part 2 – Understanding the CSS Grid Periphery
Part 3 – Exploring the Wider Ecosystem
Part 4 – A Quick Reference

Cherishing the benefits of grid layouts

The entire book has so far been about grids – how we can use CSS Grid to create them, configure their finest details, design them, and use them to our advantage. We know that grids work. We’ve seen them countless times. We take this as a fact. But why? What are the reasons for this unreasonable effectiveness of grids on the web?

Let’s look at some of the main advantages of grid layouts to understand why they’ve become a staple of web design.

The ease of design and development

A grid can be simple or complex, but it can always be described with a few variables. Usually, we see a certain number of columns with a given total width. Sometimes, we also see descriptions of rows, usually with a given height. Elements can span one or more columns and one or more rows.

For example, imagine that we want to implement a grid, with a maximum total width of 960px and with six possible columns. The main content should...