【发布时间】:2014-01-16 00:12:02
【问题描述】:
我正在使用代码来嵌入在悬停时旋转的社交网络图标。我正在为一个项目调整它们,它在this pen 中运行良好。但是当我将代码复制到括号中时,每当页面加载时,图标不会出现,直到您将鼠标悬停在正方形上。有人知道我在哪里出错了吗?
HTML
<section>
<ul id='services'>
<li>
<div class='entypo-facebook'></div>
</li>
<li>
<div class='entypo-twitter'></div>
</li>
<li>
<div class='entypo-gplus'></div>
</li>
<li>
<div class='entypo-linkedin'></div>
</li>
</ul>
</section>
CSS
@import url(http://weloveiconfonts.com/api/?family=entypo);
/* entypo */
[class*="entypo-"]:before {
font-family: 'entypo', sans-serif;
}
html, body {
margin: 0;
background-color: #ECF0F1;
}
section #services {
text-align: center;
transform: translatez(0);
}
section #services li {
width: 40px;
height: 40px;
display: inline-block;
margin: 20px;
list-style: none;
}
section #services li div {
width: 40px;
height: 40px;
color: #ECF0F1;
font-size: 1.2em;
text-align: center;
line-height: 40px;
background-color: #cccccc;
transition: all 1s ease;
}
section #services li div:hover {
transform: rotate(360deg);
-ms-transform: rotate(360deg); /* IE 9 */
-webkit-transform: rotate(360deg); /* Safari and Chrome */
border-radius: 100px;
-webkit-border-radius: 100px;
-moz-border-radius: 100px;
background-color: #303030;
}
【问题讨论】: