5. The Grid’s the Thing CSS was not designed to describe 2D grids. Rather, CSS assumes that every page will be made up of a vertical stack of blocks, piled(堆叠) one on top of another, each containing either another stack of blocks, or text (called inline content) wrapped to fit inside the block.
8. Tables Do the Trick Absolute positioning and floated blocks can be employed to force blocks to sit alongside other blocks—a purpose never envisioned by its creators.
16. Table-relative value Internet Explorer 8 will support many new values for the CSS display property, including the table-related values: table, table-row, and table-cell—and it’s the last major browser to come on board with this support.
19. Internet Explorer 8+, Firefox, Safari, Opera Our three-column equal-height layout is achieved without having to resort to tricks like faux(假的)columns using background images, worrying about positioning, or having to clear floats—revolutionary!
20. Hang on … Aren’t Tables for Layout Wrong? The table value of the display property, on the other hand, is simply an indication of how something should look in the browser—it has no semantic meaning.
21. Anonymous Table Elements if we use display: table-cell; without first containing the cell in a block set to display: table-row;, the row will be implied—the browser will act as though the declared row is actually there.
22. Anonymous Table Elements .main{overflow:hidden;_overflow:visible;_zoom:1;} Can be replaced by: .main{display:table-cell;_overflow:visible;_zoom:1;} Or .main{display:table;_overflow:visible;_zoom:1;}
30. Colspan/rowspan CSS tables lack any concept of row or column spanning, making it trickier to use one single layout structure than what might have been possible when using HTML tables. However, similar layouts can be achieved by using nested CSS tables.
32. Do I have to change the source order? search engine optimization accessibility
33. SEO The truth is, however, that source order has little impact on either of those areas. Of far more importance than source order is a proper heading structure: a properly nested sequence of heading tags (<h1> to <h6>) to clearly identify the page topic and sections.
37. Option 1:Ignore Older Browsers If you’re designing for yourself and nobody else, this is an option you might want to consider—it’ll certainly save you some time, and if you’re looking to make a point, this is the most visible way to do it.
39. Option 3:Reproduce What you need to do is reproduce your table-based layout as closely as possible using the features available in IE6 and 7.
40. Why Not Stick with Floated Layouts? If we don’t start using those features now, then who’s holding back the Web? The users who haven’t upgraded their browsers? Until we build sites that take advantage of the new features added to the latest browsers, how can we expect those users to upgrade? Microsoft has done its part; now it’s our turn.
46. CSS3 Grid Positioning Module Imagine being able to define a grid for your page, then snap elements to that grid!
47. CSS3 Grid Positioning Module In the case of a body with no width applied, they’d evenly stretch if the window was resized.
48. CSS3 Grid Positioning Module Since this is a repeating pattern, we can also use the following notation instead of specifying all of the columns individually:
49. CSS3 Grid Positioning Module Since this is a repeating pattern, we can also use the following notation instead of specifying all of the columns individually:
53. CSS3 Template Layout Module To set up the three-column template, we use the display property with a value of “abc”, a letter for each template slot(槽).
55. CSS3 Template Layout Module CSS3 templates can be even more complex than that. We don’t have enough room in this book to speculate on all the possibilities
58. Everything You Know about CSS is Wrong By keeping your techniques up to date and not expecting life to remain the same, you can ensure that you’re not left behind as techniques and support move on.