Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


Kyle Arbuckle
Kyle Arbuckle
1,124 Points

How to add Custom CSS to a specific page (did not work in the video when Zac did it)

around 1:03 in the video, Zac adjusts the padding in the style.css file for the #featured panel so that it's a certain amount on the homepage and less on the other pages. When he does this, it changes all the pages to the updated padding including the homepage.

How do you add a CSS style that just affects a single page?


1 Answer

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,053 Points

You could try creating a very specific template file e.g. single-services.php... and going into the template via the admin area.. Then create a style attribute in one of the html elements and apply the style there. In fact if you note the class it doesn't even need to be an inline style.

You should be able to access any of the template files by going into your Admin area

Appearance -> Editor

Good luck :)