Grid overlay via CSS and a PNG

While working on a site’s CSS, I’ve been using transparent PNGs to overlay a grid image on the page in order to align design elements to the grid. Previously, I specified a repeating background grid image on the body tag, and commented it out when I didn’t want to see the grid. That works fine, but any child elements that use background images or colors will sit on top of the grid, obscuring it. And the repeating grid image will take the place of any background image which is supposed to be part of the design.

Flash on a grid

A while back I started investigating grids—what they were, and how they could help my design. As a web designer, I never thought much about grids. It seemed to be some esoteric thing print designers used. Back in the table-based layout days, I probably used grids without even knowing it. Table columns and rows naturally structured the layout, the cellspacing attribute acted as a gutter between rows and columns, and cellpadding added a bit of buffer for the text. Of course, I normally set both to zero for pixel-precise layouts. I’m glad I don’t work that way anymore…