I am trying to make circle navigation animated with CSS, but the problem is that when the mouse hovers over one of the menu links, all the menus use the effect that I wanted to be only on the selected link. Is there is any way to do this?
here is the link for my result: http://jsfiddle.net/amromar/Fgnmw/
CSS:
#nav li {
list-style:none;
list-style-type:none;
display:table-cell;
ul.box li {
display: block;
width:100px;height:100px;border-radius:1000px;font-size:20px;color:#fff;line-height:100px;text-align:center;background:#000;
}
ul.box li{ -webkit-transition: width 0.2s ease, height 0.2s ease;
-moz-transition: width 0.2s ease, height 0.2s ease;
-o-transition: width 0.2s ease, height 0.2s ease;
-ms-transition: width 0.2s ease, height 0.2s ease;
transition: width 0.2s ease, height 0.2s ease;
overflow: hidden; }
ul.box:hover li{
display: block;
width:200px;height:200px;border-radius:1000px;font-size:30px;color:#fff;line-height:100px;text-align:center;background:#333;
overflow: hidden;
}
HTML:
<ul class="box" id="nav" >
<li >home</li>
<li><a href="#">about</a></li>
<li>our tour</li>
<li>contact</li>
<li>hellow</li>
</ul>
I originally thought (and had posted then deleted) that you just needed to change the
:hoverto thelielement, so this selectorul.box:hover lito thisul.box li:hover. But that was only part of the solution, because the sizing problem was yourdisplay: table-cellon thelielements, which was forcing them to expand to the height of the wrapper. I believe I have come up with an acceptable solution to get what you seem to want to achieve (has similar effects as thedisplay: table-cellonly without the height issue).Here is the fiddle.
CSS