Created
June 24, 2011 22:51
-
-
Save jlong/1045839 to your computer and use it in GitHub Desktop.
3-column grid trick with nth-child clearing for variable height elements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
section.three-column-grid { | |
clear: both; | |
width: 960px; | |
@include clearfix; | |
> section { | |
float: left; | |
padding: 0 10px; | |
width: 300px; | |
} | |
// Must have at least IE 9 | |
> section:nth-child(3n+4) { | |
clear: both; | |
} | |
} |
- http://html5doctor.com/the-section-element/ Look under "rule of thumb"
Sigh... it is a "rule of thumb"...
But thanks for the criticism. Definitely helps me think better about my HTML.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you send me a URL for point number 1?
From A Book Apart's "HTML 5 for Web Designers", Jeremy Keith writes:
"The section element is used for grouping together thematically-related content. That sounds a lot like the div element which is often used as a generic container. The difference is that div has no semantic meaning; it doesn't tell you anything about the content within. The section element on the other hand, is used explicitly for grouping related content."
So it has nothing to do with whether there is a heading inside or not. Headings help create outlines if you have the right tool (I know of none, but that's the idea).
On 2, I can see the advantage, but prefer the more obvious presentational class name.