If you want to locate 30 points from the left and 5 points from the top, what can you do? BR>
#navigation
{
position: absolute;
left: 30px;
top: 5px
}
Of course, you can also do this:
margin: 5px 0 0 30px
Note that the order of the 4 numbers is: up, right, down, left. Of course, sometimes positioning rather than margins is better.
10. Background color straight to the bottom of the screen
Control in the vertical direction is beyond the capabilities of CSS. If you want the navigation bar to go straight to the bottom of the page like the content bar, using a table is very convenient, but if you only use CSS like this:
#navigation
{
background: blue;
width: 150px
}
A shorter navigation bar will not go straight to the bottom, it will end when the content ends halfway. What to do?
Unfortunately, the only way to cheat is to add a background image to the shorter column, with the same width as the column width, and make it the same color as the set background color.
body
{
background: url(blue-image.gif) 0 0 repeat-y
}
You cannot use em as the unit at this time, because then the trick will be revealed once the reader changes the font size, and you can only use px.
11. Comparison between Block and inline elements
All HTML elements are either block or inline. The characteristics of the block element are:
Always start on a new line;
Height, line height and top and bottom margins can all be controlled;
The width defaults to 100% of its container unless a width is set