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 JavaScript Foundations Variables Basics

css with 2 different stylesheets

im doing a rails app and trying to style the home page that i different from other pages. however when i try to link the css to the specific stylesheet i want, it always homepage (application.css). Also when im just styling 2 pages (not the homepage) it styles the page which i saved last in css.

can someone give me some insight how to style each individually.

1 Answer

David Curtis
David Curtis
11,301 Points

good info on cascading: http://www.w3.org/TR/2011/REC-CSS2-20110607/cascade.html#cascade

the order in which you list the css files in your application.html file matters. if they are in the wrong order, you won't get the desired effects you're looking for within the page. put your specific css files below your main.css file, for example.

have you tried wrapping the page content in a div? if you're having problems, this is an easy hack. i.e. <div id="home_page">. since i don't know exactly what you're trying to accomplish, it's kind of hard to give you an exact answer.