我有一个相当简单的 css3 标记,它显示了一个很酷的悬停效果。我需要一个预 Internet Explorer 10 后备。我也不能让它看起来 100% 正确,但这里的代码永远不会少:
HTML
<ul class="ca-menu">
<li>
<a href="#">
<span class="ca-icon">$</span>
<div class="ca-content">
<h2 class="ca-main">Exceptional Service</h2>
<h3 class="ca-sub">Personalized For You</h3>
</div>
</a>
</li>
</ul>
CSS
.ca-menu{
padding: 0;
margin: 20px auto;
width: 500px;
}
.ca-menu li{
width: 500px;
height: 100px;
overflow: hidden;
display: block;
background: #fff;
box-shadow: 1px 1px 2px rgba(0,0,0,0.2);
margin-bottom: 4px;
border-left: 10px solid #797979;
transition: all 300ms ease-in-out;
}
.ca-menu li:last-child{
margin-bottom: 0px;
}
.ca-menu li a{
text-align: left;
display: block;
width: 100%;
height: 100%;
color: #797979;
position:relative;
}
.ca-icon{
font-family: Century Gothic, sans-serif;
font-weight: normal;
font-style: normal;
font-size: 20px;
text-shadow: 0px 0px 1px #797979;
line-height: 90px;
position: absolute;
width: 90px;
left: 20px;
text-align: center;
transition: all 300ms linear;
}
.ca-content{
position: absolute;
left: 120px;
width: 370px;
height: 30px;
top: 1px;
}
.ca-main{
font-size: 30px;
transition: all 300ms linear;
font-family: Century Gothic, sans-serif;
font-weight: normal;
font-style: normal;
margin-bottom:-5px;
}
.ca-sub{
font-size: 14px;
color: #797979;
transition: all 300ms linear;
font-family: Century Gothic, sans-serif;
font-weight: normal;
font-style: normal;
margin-top:-5px;
}
.ca-menu li:hover{
border-color: #57C5E0;
background: #797979;
}
.ca-menu li:hover .ca-icon{
color: #57C5E0;
text-shadow: 0px 0px 1px #57C5E0;
font-size: 50px;
}
.ca-menu li:hover .ca-main{
color: #57C5E0;
font-size: 14px;
}
.ca-menu li:hover .ca-sub{
color: #fff;
font-size: 30px;
}
工作演示点击这里!
我的标记中唯一的 css3 是transition
效果,我觉得它们应该是旧浏览器的简单 css2 替代品。我想到了Javascript,但不确定是什么。有帮助吗?