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


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,252 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 :)