Styling the #content ContainerThe #content container needs to be set to float: left so that it sits beside the #nav container. You also will need to set a width, which in this case will be 475px. To create a gutter between the two columns, use margin-left: 45px. Finally, padding needs to be applied to the top and bottom of the container. You will need to use padding: 15px 0 as shown in Listing 19.9. The results can be seen in Figure 19.8. Listing 19.9. CSS Code for Styling the #content Containerbody
{
text-align: center;
background: #B0BFC2;
color: #444;
}
#nav
{
float: left;
width: 130px;
display: inline;
margin-left: 20px;
padding: 15px 0;
}
#nav ul
{
margin: 0;
padding: 0;
list-style-type: none;
text-align: right;
}
#nav li
{
background: url(header-bullet.gif) no-repeat 100% .4em;
padding: 0 10px 5px 0;
}
#content
{
float: left;
width: 475px;
margin-left: 45px;
padding: 15px 0;
}
Figure 19.8. Screenshot of styled #content container.
|
| |||||||||||||||||||