Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Single CSS File and Multiple Pages Reply To: Single CSS File and Multiple Pages

#236870
Beverleyh
Participant

my professor said it was bad practice because if i change it I would change the entire site

That’s the beauty of a common CSS (or JS) file – consistent styling around your site can be changed easily from one place.

Unless individual pages contain reams of custom CSS, you’re fine to put it all in the one file. It’s text-based – it minifies and compresses well, so a few extra bytes on the overall size of the CSS file trumps an extra HTTP request for a secondary stylesheet.

Everyone has their own preferences but you could define common styles right at the top of your CSS file and then add small blocks of custom CSS for any pages that need something more below.