我开始变得绝望,因为我无法弄清楚这一点,所以我想向你们寻求帮助。
HTML:
<div id="wp-nav">
<ul>
<li><a href='#'>ENGLISH</a>
<ul>
<li><img src="images/gb.gif"/>
</li>
</ul>
</li>
<li><a href='#'>SRPSKI</a>
<ul>
<li><img src="images/rs.gif"/>
</li>
</ul>
</li>
</ul>
</div>
CSS:
#wp-nav {
text-align: center;
margin: 0 auto;
position: relative;
top: 130px;
width: auto;
}
#wp-nav ul {
margin: 0;
padding: 0;
list-style: none;
}
#wp-nav > ul > li {
margin-top: 20px;
padding: 0;
background: #000;
border-radius: 10px;
opacity: 0.8;
width: 150px;
height: 50px;
}
#wp-nav > ul > li {
display: inline-block;
position: relative;
}
#wp-nav > ul > li:hover {
background: #fff;
}
#wp-nav ul li a {
display: block;
margin: 0;
padding: 0;
text-decoration: none;
color: #fff;
font-family: Verdana, "Open Sans", sans-serif;
font-size: 12px;
line-height: 50px;
-webkit-transition: color .15s;
-moz-transition: color .15s;
-o-transition: color .15s;
transition: color .15s;
}
#wp-nav > ul > li > a:hover {
color: #000;
}
#wp-nav > ul > li > ul {
margin: 10px auto 0;
opacity: 0;
visibility: hidden;
background-color: rgba(0, 0, 0, 0);
text-align: center;
width: 45px;
height: 30px;
-webkit-transition: all .3s .1s;
-moz-transition: all .3s .1s;
-o-transition: all .3s .1s;
transition: all .3s .1s;
}
#wp-nav > ul > li:hover > ul{
opacity: 1;
visibility: visible;
}
所以,基本上,当我将鼠标悬停在英语上时,我希望英国国旗显示在选项卡下方,但我不想保留英语的任何属性,<li>
当我 :hover that flag 时,我不希望英语<li>
保持白色如果它悬停。塞尔维亚语也是如此。
提前致谢。