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 i use the 1 css file for more than 1 html file

i have created a 5 page website and want to change this css in every page how do i do this

2 Answers

Steven Parker
Steven Parker
230,248 Points

Any HTML file that uses the CSS file must load it, usually with a "link" element added to the "head" area.

To have all the pages share the same CSS file, just place the same loading line into each of the HTML files.

Liam Ferb
Liam Ferb
8,454 Points

add <link rel="stylesheet" href="Link to the css file goes here..."> to the head portion of the html document.