Don’t Overthink It Grids

The vast majority of websites out there use a grid. They may not explicitly have a grid system in place, but if they have a “main content area” floated to the left a “sidebar” floated to the right, it’s a …

Avatar of Chris Coyier
Chris Coyier on (Updated on )

Better Box Sizing

Direct Link

Paul Irish suggests the universal selector (*) to apply border-box box-sizing to every element. I’ve been wanting to try this forever because this box model is, in my opinion, just better. Imagine: elements with percentage widths and pixel padding without …

Avatar of Chris Coyier
Shared by Chris Coyier on (Updated on )

Child and Sibling Selectors

Do you know what the difference between these selectors are?

ul li { margin: 0 0 5px 0; }
ul li { margin: 0 0 5px 0; }

I’ll admit it took me longer than it probably should have (way …

Avatar of Chris Coyier
Chris Coyier on (Updated on )

The Skinny on CSS Attribute Selectors

CSS has the ability to target HTML elements based on any one of their attributes. You probably already know about classes and IDs. Check out this bit of HTML:

<h2 id="title" class="magic" rel="friend"David Walsh</h2

This single element has three …

Avatar of Chris Coyier
Chris Coyier on (Updated on )