Currently experimenting with a new design for my website to test out the look and feel.
The top navigation bar is looking good, except for one issue I've encountered.
Hovering over text-only links works perfectly fine - with added top-padding creating a nice "moving/growing" effect on the navigation tabs.
However, hovering over links that contain images (such as Paypal, Twitter, YouTube) causes an unexpected problem where the top-padding affects the position of the main parent element. This issue has been identified in the latest versions of Chrome and Firefox for Windows 7.
It's worth noting that it's not the BODY that's affected, but rather #main (as specified in my CSS) also experiences the "moving/growing" effect.
You can view the URL here: and below is the corresponding code:
#main{
width:94%;
max-width:880px;
margin:12px auto;
background:#fff;
box-shadow:1px 1px 4px #000;
border-radius:4px;
padding:2px 2px 8px 2px;
}
#nav{
position:relative;
top:-0.8em;
background:#fff;
border-radius:4px;
padding:2px;
display:inline-block;
}
#nav a{
color:#000;
display:inline-block;
padding:1px 1em 1px 1em;
border-radius:0 0 4px 4px;
box-shadow:0px 2px 2px -2px #fff inset, 0px -4px 16px -6px #aaa inset;
-webkit-transition:background 0.5s, padding-top 0.25s;
-moz-transition:background 0.5s, padding-top 0.25s;
vertical-align:top;
}
#nav a:hover{
padding-top:4px;
background:#eee;
}
#nav a:hover img{
-webkit-transition:-webkit-filter 1.5s;
}
#nav a:hover img{
-webkit-filter:hue-rotate(360deg);
}
I'm seeking advice on how to address this issue without sacrificing the "moving/growing" effect on both textual and image-based links. Appreciate any insights or solutions offered in advance.