I am trying to make a horizontal menu and have a couple of problems:
1) When home is selected I want it to highlight it the same color i.e: #b2b2b2
however at the minute I cannot figure out how to do this. I also want it to do the same for the about us page etc (but havent added this to the code at the minute).
2) I want the menu to be horizontal at the minute it keeps going on top of each other and the spacing is really tight.
I want it like:
Home | About | Products | Contact Us | Special Offers
1) When home is selected I want it to highlight it the same color i.e: #b2b2b2
however at the minute I cannot figure out how to do this. I also want it to do the same for the about us page etc (but havent added this to the code at the minute).
Quote:
I do set in my include page the page class: <body class="home">
Code:
.home #main-nav a{
color: #b2b2b2;
}
Quote:
2) I want the menu to be horizontal at the minute it keeps going on top of each other and the spacing is really tight.
By default, anchors are inline elements, so they should sit in line with other. You may have some other CSS rule than the above which might be affecting them.
You may override it by adding either display:inline; or float:left; to your #main-nav a (though there will some difference in the behavior of the items for these two)
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
I have added: .home #main-nav a{
color: #b2b2b2;
} into my code but that just turns my whole menu, b2b2b2 and nothing happens on selection or hover?
I used your code to replace: body.home main-nav#home,
body.home main-nav#home a,
body.home main-nav#home a:hover,
color: #b2b2b2;
}
which I know is wrong.
added this but the only problem is home is always highlighted now? When I click about home still stays highlighted?
I want to go through and repeat it with about, contact us etc... so when they are selected they are in the font #b2b2b2 but as I say above home is always highlighted.
Just so you know where I am at:#.css code #main-nav {
height: 50px;
background-color: #ebecf0;
margin-left: 160px;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
font-size: 11px;
}
#main-nav a {
color: #ff75ba;
text-decoration: none;
}