html - 影响文本的CSS不透明度过渡

标签 html css

我的导航栏有问题..尝试仅使用 html 和 css 复制“Dragon interactive”导航(这仍然是新的,所以我还不能处理 javascript 或 jquery!!)。 由于渐变背景上的过渡在 css 上不可用,我尝试了不透明度......对于背景来说似乎工作得很好但是当鼠标悬停时导航栏文本消失了!任何想法家伙如何简单地克服这个问题!!(仅限 css :p) html

<div class="wrapper">
<div class="container"><ul class="menu" rel="sam1">
<li class="active"><a href="#">Acceuil</a></li>
    <li><a href="service.html"><span>Services</span></a></li>
    <li><a href="#">assistance</a></li>
    <li><a href="http://www.ats.dz" target='_blank'>Produits</a></li>
    <li><a href="#">Contacts</a></li>
</ul>
</div></div>

CSS

.wrapper {
width: 100%;
height: 70px;
background : #464646;
background : -webkit-gradient(linear, left top, left bottom, from(rgb(168,168,168)), to(rgb(69,69,69)));
background : -moz-linear-gradient(top, rgb(168,168,168), rgb(69,69,69));
border-top: 0px solid #939393;
position: relative;
margin-bottom: 30px;
margin-left:150px;

}

ul {
margin: 0;
padding: 0;
}

 ul.menu {
height: 70px;
border-left: 1px solid rgba(0,0,0,0.3);
border-right: 1px solid rgba(255,255,255,0.3);
float:left;
}

 ul.menu li {
list-style: none;
float:left;
height: 69px;
text-align: center;
background: -webkit-gradient(radial, 50% 100%, 10, 50% 50%, 90, from(rgba(31,169,244,1)), to(rgba(0,28,78, 1)) );
background: -moz-radial-gradient(center 80px 45deg, circle cover, rgba(31,169,244,1) 0%, rgba(0,28,78, 1) 100%);

}

ul li a {
display: block;
padding: 0 20px;
border-left: 1px solid rgba(255,255,255,0.1);
border-right: 1px solid rgba(0,0,0,0.1);
text-align: center;
line-height: 69px;
background : -webkit-gradient(linear, left top, left bottom, from(rgb(168,168,168)), to(rgb(69,69,69)));
background : -moz-linear-gradient(top, rgb(168,168,168), rgb(69,69,69));
-webkit-transition-property: opacity;
-webkit-transition-duration: 1.5s;
-moz-transition-property: opacity;
-moz-transition-duration: 1.5s;
text-decoration:none;
color:#000;
font-weight:bold;
text-transform: uppercase;
font-size:13px;
opacity:1;
}

ul li a:hover {
opacity:0;

 }

 ul li.active a{
background: -webkit-gradient(radial, 50% 100%, 10, 50% 50%, 90, from(rgba(31,169,244,1)), to(rgba(0,28,78, 1)) );
background: -moz-radial-gradient(center 80px 45deg, circle cover, rgba(31,169,244,1) 0%, rgba(0,28,78, 1) 100%);
color:#fff;
 }

谢谢!!

最佳答案

好吧,这是因为这条线:

ul li a:hover {
    opacity:0;
}

关于html - 影响文本的CSS不透明度过渡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20453345/

相关文章:

javascript - 如何从多选下拉列表中选择选项值时动态生成文本框

javascript - 过渡效果不起作用jquery

javascript - 设置具有相对位置的 div 的最小宽度

css - 为什么我的溢出省略号在 Chrome 中被截断了?

javascript - 如何在单击按钮 Angularjs 时获取表行值

css - :focus not working as expected in IE

javascript - 包裹 iframe

html - 表单在 Firefox 中看起来不错,但在 Chrome 中看起来很乱

javascript - 使用小屏幕时强制在按钮文本内换行

html - CSS 多背景图片