3
I’m creating two horizontal menus on the same page with different settings and so I used a class in each of them.
I’m not getting one of these menus to get the one-color box on have
What I did was give one padding to each of the menu items so that when the mouse is passed it will be that color.
I gave a yellow color to show the default state and another yellow, lighter, when passing the mouse.
In short: The problem is that when passing the mouse the light yellow color does not occupy all the yellow that is in premanence - http://jsfiddle.net/Lyu65/
My current code:
ul.nav{
font-family: globerthin, Verdana, Arial, Geneva, sans-serif;
list-style-type: none;
margin-top: 50px;
}
ul li.nav{
display: inline;
background-color: yellow;
color: black;
margin-left: 20px;
padding-left: 25px;
padding-top: 25px;
padding-right: 25px;
padding-bottom: 25px;
font-size: 125%;
font-weight: bold;
}
.nav a:link{
color: black;
text-decoration: none;
}
.nav a:visited {
color: black;
text-decoration: underline;
}
.nav a:hover{
background-color: #faf6eb;
text-decoration: none;
}
.nav a:active{
color: black;
text-decoration: underline;
}
<ul class="nav">
<li class="nav"><a href="index.html#equipamentos" title="Navegar para Eqipamentos">EQUIPAMENTOS</a></li>
<li class="nav"><a href="index.html#actividades" title="Navegar para actividades">ACTIVIDADES</a></li>
<li class="nav"><a href="index.html#duvidas" title="Navegar para dúvidas técnicas">DÚVIDAS TÉCNICAS</a></li>
<li class="nav"><a href="index.html#reparar" title="Navegar para ás reparações de equipamentos">REPARAÇÃO DE EQUIPAMENTO</a></li>
<li class="nav"><a href="index.html#usados" title"Navegar para usados">USADOS</a></li>
<li class="nav"><a href="index.html#blogue" title="Navegar para ao blogue">BLOGUE</a></li>
Post your HTML, but from what you reported, if there are two menus different by setting the same class for both menus it will be equal. Assuming I’m right, you either work with unique Ids, one for each menu and style them individually or a different class for each, but still style them individually. If there are properties with shared styles, you can group them in the same rule.
– Bruno Augusto
No Bruno. I created each class with a different attribute. See the html I edited the question.
– David
Either you put only part of the code or really nay, you used the same class for all elements (they all have
class="nav"
). Worse! You gave the same class both for the list (<ul>
) how much for your items (<li>
).– Bruno Augusto
So how should I do?
– David