新しい FontAwesome 4.0.0 には、積み重ねられた項目の CSS スタイルがあります。
<span class="fa-stack">
<i class="fa fa-square-o fa-stack-2x"></i>
<i class="fa fa-twitter fa-stack-1x"></i>
</span>
.fa-stack {
position: relative;
display: inline-block;
width: 2em;
height: 2em;
line-height: 2em;
vertical-align: middle;
}
.fa-stack-1x,
.fa-stack-2x {
position: absolute;
width: 100%;
text-align: center;
}
.fa-stack-1x {
line-height: inherit;
}
.fa-stack-2x {
font-size: 2em;
}
.fa-square-o:before {
content: "\f096";
}
span
ネストされたandを使用せずi
に、いくつかの css-classesのみを使用してのみ実行したい
.myclass1 { ... }
.myclass2 { ... }
<span class=".... myclass2" />
同じ結果を得る最も簡単な方法は何ですか (fa コンテンツ クラスを使用しますか?)
更新:または、次のようなことは可能ですか?
.myclass1:before { content: '<span class="fa-stack">
<i class="fa fa-square-o fa-stack-2x"></i>
<i class="fa fa-twitter fa-stack-1x"></i>
</span>' }
<span class=".... myclass1" />