Is there any way to embed HTML in the css content:
element when using a :before
pseudo-element?
I want to use a Font Awesome (or Glyphicon) in a use case like this:
h1:before {
content: "X";
padding-right: 10px;
padding-left: 10px;
color: @orangeLight;
}
Where X
is something like <i class="icon-cut"></i>
.
I can, of course do this manually in HTML, but I really want to use :before
in this case.
Similarly, is there any way to use <i>
as a list bullet? This works, but doesn't behave correctly for multi-line bullet items:
<ul class="icons">
<li><i class="icon-ok"></i> Lists</li>
<li><i class="icon-ok"></i> Buttons</li>
<li><i class="icon-ok"></i> Button groups</li>
<li><i class="icon-ok"></i> Navigation</li>
<li><i class="icon-ok"></i> Prepended form inputs</li>
</ul>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…