0
请参阅我的项目:http://www.livingthelighterlife.com/如何更改:before元素上的悬停背景颜色?
试图让社交媒体部分的悬停背景色工作。图标通过:before标签出现。我尝试添加:之前:悬停,但它不工作。
此外:我似乎无法弄清楚为什么每个之间都出现破折号。请帮助解决这个问题!
任何帮助,将不胜感激!
[class^="icon-"]:before, [class*=" icon-"]:before {
\t display: inline-block;
\t line-height: 1em;
\t width: 1em;
\t font-family: "fontello";
\t font-size: 20px;
\t color: #ffffff;
\t font-weight: normal;
\t text-align: center;
\t padding: 5px;
\t padding-left: 6px;
\t border-radius: 50%;
}
.icon-rss:before, .icon-pinterest:before, .icon-twitter:before {
\t background: #4a4947;
}
.icon-rss:before:hover, .icon-pinterest:before:hover, .icon-twitter:before:hover {
\t background: #f15c58 !important;
}
.icon-facebook:before, .icon-instagram:before, .icon-heart:before {
\t background: #f15c58;
}
.icon-facebook:before:hover, .icon-instagram:before:hover, .icon-heart:before:hover {
\t background: #4a4947;
}
.icon-rss:before { content: '\e801'; } /* '' */
.icon-facebook:before { content: '\f30c'; } /* '' */
.icon-pinterest:before { content: '\f312'; } /* '' */
.icon-instagram:before { content: '\f32d'; } /* '' */
.icon-twitter:before { content: '\f309'; } /* '' */
.icon-heart:before { content: '\e802'; } /* '' */
<span class="icon-rss"></span>
</a>
<a target="new" href="#">
<span class="icon-facebook"></span>
</a>
<a target="new" href="#">
<span class="icon-pinterest"></span>
</a>
<a target="new" href="#">
<span class="icon-instagram"></span>
</a>
<a target="new" href="#">
<span class="icon-twitter"></span>
</a>
<a target="new" href="#">
<span class="icon-heart"></span>
哪个标签添加文字修饰:无? – Samantha
a标签:a {text-decoration:none; } –
不要以为你需要跨度,你可以通过使用等简化它。 –