1
我想从jquery中设置字体的数据属性,出于某种原因图标不显示,我看到了实际的文本。Css显示jquery中的字体和数据属性的图标
.someClass {
position: relative;
white-space: nowrap;
display: inline-block;
cursor: pointer;
&::before, span::before {
font-family: FontAwesome;
text-shadow: .05em .05em #aaa;
content: attr(data-content);
color: #AAA;
font-size: rem-calc(20px);
line-height: 1;
letter-spacing: 4px;
}
}
$('.someClass').attr('data-content','\f005');
当我这样做没有jQuery的这个样子,这是工作:
content: "\f005";
不工作.... – user233232