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

CSS How to Make a Website Responsive Web Design and Testing Adding Breakpoints for Devices

Zach Meissner
Zach Meissner
1,347 Points

Is it possible to do an HTML 'includes' for the header so we don't have to copy and paste the same information 3 times?

I'm wondering if there is an HTML equivalent to the PHP includes where you can create the code once, and have it included on all subsequent pages. For instance, when adding a new style sheet, it has to be added on every page, or when changing footer info.

For a site that will have dozens of pages, this isn't practical.

How does one easily make changes to multiple pages?

1 Answer

Hi Zach,

Unfortunately not but, it is very achievable through well structured HTML and good use of class's and id's that should you wish to change anything the minimal amount of code will need editing.

Best advice i have is to concentrate on grouping relevant content together and if you are keeping your css nice and dry then the code to change a group of elements on multiple pages with the same background and font style should be pretty quick!

Hope this helps Craig

Zach Meissner
Zach Meissner
1,347 Points

Thanks much Craig.

What is the Ruby on Rails equivalent of an 'includes' like in PHP? Not sure on the name of that block of code.

I wouldn't be able to tell you Zach I have 0 experience with ruby as programming language .... sorry