Summary 6

Stylin' with CSS Chapter 5


Table Tag

If you want a table in your layout, consider using the table, tr tag, and display table, table-row or table-cell. These can we useful because you don’t have to worry about padding breaking the layout like when you use float. Tables if you don’t specify a width are automatically fluid. Keep in mind that that table are not supported by IE7.


Section and ID

Instead of creating new and different classes for each article that is a little different than the first one, you can keep the article tag (or other element tag) and use ID in the top level of your main section followed by all the article tags. This will help with readability of your CSS and HTML. To make changes to on article in you CSS it’s the section followed with no space the ID name a space then the tag (article) : and what child you want to change. In the brackets add the changes.


Divs can be used for adding style to inline elements

Without breaking the layout, you can add divs around or inside of inline elements to add borders and padding. Normally when you add a boarder around an element, already correctly sized for the layout, it with push some of the inline element to the next line or add a scroll bar. When using a div it will resize the child element to fit the new space.