Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font Awesome CSS overriding my CSS

I am working on a page - click here for link. The icons are all supposed to have the font size of .side-icon:

.side-icon{ 
    font-size:28px;
}

BUT a style in font-awesome.css is overriding this, no matter where I include the library in the layout.

At the moment I have included the css in the top of a work around sheet (font-awesome-fix.css) using an @import, but I cannot get the 'font: normal normal normal 14px/1 FontAwesome;' to disappear at all.

Please help!

like image 966
asoxus Avatar asked Feb 27 '15 16:02

asoxus


People also ask

Can you use Font Awesome in CSS?

CSS has an awesome feature called Pseudo-elements . Using Pseudo-elements we can add content to the web page with just CSS. Font awesome uses ::before pseudo-element to add icons to the page using their CSS content codes.

How do I get rid of Font Awesome?

Remove Font Awesome from your website by editing style.@import url(/css/font-awesome. min. css); or @import url(https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css); Once you delete these Font Awesome imports from CSS, Font Awesome will stop loading on your website.

Why Font Awesome does not work?

Make sure you're using the latest and greatest by updating your CDN code reference, updating your Font Awesome package via npm, or downloading a fresh copy of Font Awesome. You can check with version an icon was added to on its detail page (e.g. question-circle was added in Verion 1 but last updated in 5.0. 0).


2 Answers

Make your selector more specific :

.side-icon.fa

See here how the priorities of the selectors are calculated.

like image 161
Brewal Avatar answered Sep 28 '22 05:09

Brewal


Hey you should target the before element :

.side-icon:before{ 
    font-size:28px;
}
like image 24
Mat Avatar answered Sep 28 '22 05:09

Mat