css| Navigation | page
Check the relevant data, in the process found that the use of flash to achieve this effect
Need to pass backstage, this because I do not understand, for the moment not to watch, talk about recently learning CSS
How to use CSS to implement the same navigation code on different pages
Principle:
By defining an ID for the body of each page
Based on the inheritance characteristics of the CSS ("seems to have this statement, I am sorry to remember not very clear")
Using the form of #body #nav a
Implemented in different pages
The color of the link that corresponds to the page is different from the color of the other links
Here's a look at my code:
Regular links can be defined as this
#topnav A:hover,
#topnav a:focus{background: #555;}
#topnav a:active {
Background: #920D02;
Color: #fff;
}
Define a hyperlink that is different from a generic link
#home #nav-home A,
#contact #nav-contact a {
Background: #91cc14;
Color: #000;
}
Xhtml
<body id= "Home" >
<div id= "Topnav" >
<ul>
<li id= "Nav-home" ><a href= "index-cn.shtml" > Home </a></li>
<li id= "nav-contact" ><a href= "contact.shtml" > Contact Us </a></li>
</ul>
</div>
At this point, the goal is achieved ^_^