we set the link through the CSS styles are defined: link,: visited,: hover state. test a: link (color: # 666; background: # CCC; text-decoration: none; )
Code:
. test a: visited (color: # 666; text-decoration: underline;)
Code:
. test a: hover (color: # FFF; font-weight: bold; text-decoration: underline; background: # F00;)
A friend asked why the background color of the menu links do not fill the entire width of li Well, the solution is very simple to add the definition of a style of display: block, block-level element so that links to display. We also fine-tune the following details:
# Use text-align: center will center the menu text;
# With height: 30px add to the background of the height;
# With the margin-left: 3px so that each menu, the distance between the air 3px;
# With the line-height: 30px; the definition of the row height, so that the link text vertically centered;
# CSS definition like this:. test a (display: block; text-align: center; height: 30px; ) . test li (float: left; width: 100px; background: # CCC; margin-left: 3px; line-height: 30px; )
All the best.
Bookmarks