Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I override Bootstrap's <blockquote> border-left with a FontAwesome icon in CSS?

When a <blockquote> appears within my div, I would like to override it so that it uses FontAwesome's icon-quote-left as opposed to the border-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.

like image 375
marcamillion Avatar asked Mar 31 '13 22:03

marcamillion


People also ask

How do you put a border around Font Awesome icons?

To display Border-All font awesome icon, add predefined class name i.e., fa-border-all (with prefix fa- ) to the i tag. And we need to add corresponding font awesome icon style for the Border-All icon. Border-All icon has 1 icon style i.e.,solid.

Does bootstrap require Font Awesome?

To use the solid style of “bootstrap“, you'll need a subscription to a Pro-level plan or a perpetual Pro license that includes the specific version of Font Awesome in which this icon (or style) was released.

How do I overlay two Font Awesome icons?

To stack multiple icons, use the fa-stack class on the parent HTML element of the 2 icons you want to stack. Then add the fa-stack-1x class for the regularly sized icon and add the fa-stack-2x class for the larger icon. fa-inverse can be added to the icon with the fa-stack-1x to help with a knock-out looking effect.


1 Answers

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;
}
like image 105
Hai Nguyen Avatar answered Nov 15 '22 23:11

Hai Nguyen