Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying Bootstrap Icon before text with CSS shows code instead icon

I need to display the bootstrap Glyphicons before the element in which the .normal-text class has been used: I am trying with the following but it shows the code instead the icon.

.normal-text{
   border-left-width: 1px !important;
   font-size: 110% !important;
   color: #100cce;
   font-family: 'Book Antiqua';
}
.normal-text::after{
   content: '<span class="glyphicon glyphicon-pencil"></span>'
}
    
<blockquote class="normal-text"> Some Text </blockquote>

Help required in this please.

like image 345
Abdul Rahman Avatar asked Sep 14 '25 03:09

Abdul Rahman


1 Answers

Use unicode instead. content:'' will treat code block as a text.

.normal-text{
   border-left-width: 1px !important;
   font-size: 110% !important;
   color: #100cce;
   font-family: 'Book Antiqua';
}
.normal-text::after{
   content: "\270f";
   font-family: 'Glyphicons Halflings';
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<blockquote class="normal-text"> Some Text </blockquote>
like image 78
Abhishek Pandey Avatar answered Sep 16 '25 19:09

Abhishek Pandey