Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Using jQuery Plugins Introducing jQuery Plugins Adding a Plugin to a Web Page

Vic Mercier
Vic Mercier
3,276 Points

I don't understand why we need to pass the css file before our main CSS file.

It was mantioned but I don't understand anyway.Please explain it really clearly because I understand nothing .

3 Answers

Laura Jackson
Laura Jackson
9,519 Points

Say if you had border: blue 2px solid in your own (main) file, but then you put in the plugin CSS after and it said border: none. You'd have no border. Remember it cascades, so the last file gets priority if sharing/targeting same named selectors.

You will ultimately want your own styles/colour scheme so your file must go last.

I hope this helps you or anyone else with this question.

Vic Mercier
Vic Mercier
3,276 Points

Was it covered in a CSS course?

Henrik Christensen
seal-mask
.a{fill-rule:evenodd;}techdegree
Henrik Christensen
Python Web Development Techdegree Student 38,322 Points

I guess it is to prevent them from over-writing your main css styles - in case they use same id/class names as you, and by placing them before your own css then they won't over-write your css.

Goundo DJIKINE
Goundo DJIKINE
11,461 Points

Because the last CSS file loaded can override the others preloaded and if you the same property in those 2 files, yours overrides the presseted property