Okay so basically I have a navigation bar that consists of 5 clickable div links which are:
Home, About me, Portfolio, Experience and Contact
I am using 5 separate divs with image backgrounds because the font I have used isn't available in css. I seem to have a problem with when it comes to the styling of the links.
I have assigned;
a:hover and a:active to each div and used a different background image for both link states. So when the user hovers over the 'about me' div it displays a different image to the one it currently shows. However, the problem I'm having is that no matter what page I'm on, the images shown are the ones that relate to the "a:active". Now of course I cannot be on all five pages at the same time. Below I've placed a snippet of my code for you to look at. Any feedback would be much appreciated.
Expand|Select|Wrap|Line Numbers
- #home {
- background-image:url('../images/home.png');
- }
- #home, a:hover {
- background-image:url('../images/home-hover-active.png');
- }
- #home, a:active {
- background-image:url('../images/home-hover-active.png');
- }
- #about-me {
- background-image:url('../images/about-me.png');
- }
- #about-me, a:hover {
- background-image:url('../images/about-me-hover-active.png');
- }
- #about-me, a:active {
- background-image:url('../images/about-me-hover-active.png');
- }
Expand|Select|Wrap|Line Numbers
- <a href="./index.html">
- <div id="home"></div>
- </a>
- <a href="./about-me.html">
- <div id="about-me"></div>
- </a>