How do I override Bootstrap's <blockquote> border-left with a FontAwesome icon in CSS?
13,925
You can do this with a CSS Pseudo element. Here's a JSFiddle to demonstrate: http://jsfiddle.net/cvADH/
/* Override the bootstrap style */
blockquote {
border-left: none;
}
/* Insert the pseudo element - replicating what FontAwesome does */
blockquote:before {
content: "\f10d";
font-family: FontAwesome;
float: left;
margin-right: 10px;
}
Author by
marcamillion
Rails developer that loves finance, economics, business & tech.
Updated on July 19, 2022Comments
-
marcamillion almost 2 years
When a
<blockquote>
appears within my div, I would like to override it so that it uses FontAwesome'sicon-quote-left
as opposed to theborder-left: 5px rgb....
value it uses now.How can I do this using just CSS?
I don't want to use JS - because it adds too much load to the page.
-
marcamillion about 11 yearsI would love to see some code on how to achieve this. I know the theory, it's just the syntax and actually doing it - I am dumbfounded by :)
-
Robert Hoffmann about 11 yearsNo PC at hand so no examples.. But look up 320up framework, I know they did a drop in replacement of bootstrap icons in favor of font awesome ones. Maybe looking at their code will help you out
-
marcamillion about 11 yearsWhat is the
\f10d
? Where did you get that from? -
marcamillion about 11 yearsOh that's the CSS content value for that particular icon - astronautweb.co/snippet/font-awesome - awesome. Thanks. This is just what I wanted!
-
Robert Hoffmann about 11 yearsupdate with links to examples, the rest should be easy :) ..long version short: download bootstrap, replace sprite.less with font-awesome.less ..rebuild, enjoy.
-
qwertzman over 10 yearsand how can we do it on the blockquote with pull-right please?
-
Mario Awad over 10 years@qwertzman with the following mirrored code from the pull-left specified above: blockquote:after { content: "\f10e"; font-family: FontAwesome; float: right; margin-left: 10px; }