CSS悬停在本地工作,但不在开发服务器上
问题描述:
我试图实现的悬停效果在本地很有效,但在上传到我们的开发时并没有做任何事情。环境。CSS悬停在本地工作,但不在开发服务器上
下面是HTML ...
<a class="circle" href="/portfolio">portfolio</a>
现在,CSS ...
.circle{
display:inline-block;
width: 380px;
height: 380px;
line-height: 360px;
text-align: center;
background-color: #02193b;
border-radius: 50%;
font-size: 54px;
box-shadow: inset 0 0 0 0 rgba(0,0,0,0.6), inset 0 0 0 10px #a09176, 0 0 10px rgba(0,0,0,0.3);
transition: box-shadow 400ms ease-in-out;
-ms-transition: box-shadow 400ms ease-in-out;
-moz-transition: box-shadow 400ms ease-in-out;
-webkit-transition: box-shadow 400ms ease-in-out;
-o-transition: box-shadow 400ms ease-in-out;
color: white;
text-decoration: none !important;
text-transform: capitalize;
}
.circle:hover {
box-shadow: inset 0 0 0 0 rgba(0,0,0,0.6), inset 0 0 0 20px #a09176, 0 0 20px rgba(0,0,0,0.3);
transition: box-shadow 400ms ease-in-out;
-ms-transition: box-shadow 400ms ease-in-out;
-moz-transition: box-shadow 400ms ease-in-out;
-webkit-transition: box-shadow 400ms ease-in-out;
-o-transition: box-shadow 400ms ease-in-out;
background-color: #01142F;
}
我已经搜查,并且还没有遇到一个工作解决方案。我感谢帮助!
答
我认为问题在于CSS的排序。如here所述,您应该首先列出最后的真实属性和供应商前缀。
例如为:
.circle {
-webkit-transition: box-shadow 400ms ease-in-out;
-moz-transition: box-shadow 400ms ease-in-out;
-ms-transition: box-shadow 400ms ease-in-out;
-o-transition: box-shadow 400ms ease-in-out;
transition: box-shadow 400ms ease-in-out;
}
什么** **正是它 “不工作” 是什么意思? - https://jsfiddle.net/bg39cLpc/1/ – 2015-04-01 15:16:26
它在jsfiddle中工作得很好,元素响应悬停事件也许一些CSS规则不起作用? – Fourat 2015-04-01 15:17:43
@Paulie_D对不起,应该是更具体的...箱子阴影不会增加大小,因为它应该,并且背景颜色不会改变。 – shiftmx6 2015-04-01 15:19:07