参考资料:http://www.techandall.com/demos/socialmediaicons/
我试着用字体来达到社交图标的效果,而不是用图片。但是我不知道如果不添加额外的HTML代码,我怎么能做到这一点,我试图像这样使用它--内容:‘ssss’;而不是背景中的图像。
像这样的东西
.social-icons li.twitter a {
content:'aaa';
font-size:10px;
padding-left:5px;
color:#000;
}在上面的代码中,我故意删除了“字体-家族作为字体-非常适合测试.我能这样做吗?或者我将不得不修改slideIn和slideOut?
问候
发布于 2014-04-30 17:38:27
content属性仅适用于: only和:after伪元素。
尝试将您的样式更改为
.social-icons li.twitter a:before {
content 'aaa';
/* etc... */
}您可能需要将text-indent从a中删除并替换为overflow: hidden;,并在演示中将width和height设置为40px,这在很大程度上取决于您想要使用何种技术来隐藏原始文本。
悬停color
.social-icons li.twitter a:hover:before {
color: red;
}发布于 2014-04-30 16:46:45
是的,这里有一个例子,在您获得字体棒库之后:
.social-icons li.twitter a {
content: "\f099";
font-family: 'FontAwesome';
font-size:10px;
padding-left:5px;
color:#000;
}https://stackoverflow.com/questions/23393536
复制相似问题