Hour 13: Borders and Boxes
Within the CSS visual formatting model, all HTML elements are displayed as either inline boxes or block boxes. Property values in CSS rules affect the way these boxes are displayed by applying the styles to the content of each box.
In this hour, you'll expand on that knowledge and learn
- What the four sides of each box are called, and how to refer to them in CSS rules
- How to use the margin shorthand property to specify margins for specific sides of a box
- Which margin values to set to center boxes horizontally
- How to set the padding on each side of a box
- Which width, color, and line styles can be used on box borders
- How to set borders for specific sides of the box
- Which properties and values allow you to hide the display of a box and its contents
- How to add a message that can be seen only by non-CSS browsers
Sample Code
You can download the sample code from each hour as one package or individual files.
- Download all [0.6K tar.gz file]
- Border width example [HTML]
- Border style example [HTML]
Web Links
There are no Web links for this chapter.
Updates and Errata
There are currently no updates to this hour's content.