So, I have this made.
HTML
<div id="navholder" class="bgd">
<nav id="nav">
<ul>
<li><a href="">Почетна</a></li>
<li><a href="">Делатност</a></li>
<li><a href="">Историјат</a></li>
<li><a href="">Службе</a></li>
<li><a href="">Колектив</a></li>
<li><a href="">Контакт</a></li>
</ul>
</nav>
</div>
#navholder {
height: 60px;
text-align: center;
margin: 0 auto;
}
#nav {
height: 30px;
margin-top: 10px;
background: #B8860B;
}
#nav ul li{
margin-top: 3px;
display: inline;
font-size: 120%;
opacity: 1.0;
}
#nav ul li a {
display: inline-block;
height: 120%;
padding: 5px;
-webkit-box-shadow: -1px 0px 22px rgba(50, 50, 50, 0.5);
-moz-box-shadow: -1px 0px 22px rgba(50, 50, 50, 0.5);
box-shadow: -1px 0px 22px rgba(50, 50, 50, 0.5);
border: 1px solid white;
opacity: 1.0;
background: #DAA520;
}
#nav a:hover {
color: white;
background: black;
width: ?
}
I want the buttons once hovered over with a mouse to increase about 20%
. The problem that I found is if I use the exact width like "width: 60px
not every button is of the same size.
On the other hand if I use width: 120%
I believe the page takes the width of the whole #navholder
element which is defined by the class .bgd
.
Any ideas on how can I make this happen?
Thanks.
You could use transform: scale()
jsFiddle example
#nav a:hover {
transform:scale(1.3,1.3);
-webkit-transform:scale(1.3,1.3);
-moz-transform:scale(1.3,1.3);
}
Just increase the padding on hover:
#nav a:hover {
color: white;
background: black;
padding: 5px 10px; /* 5px top/bottom, 10px left/right */
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With