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