CSS for every page

if you were creating a website is it best to have a css for each page just in case you want to change a layout or colour of the page so it is different to the rest?

So you’re basically asking — “would it be ok to have a specific CSS file for each page that contains CSS unique to just that page?”

This being the case I would say yes, although it probably depends on how much CSS we are talking about, and how many pages.

If you’ve only got a few lines of different CSS for a bunch of different pages, then it would be more performant to just put it all in one CSS file and save on the extra HTTP requests. If you’ve got say, one or two pages that use a lot of unique CSS, then it might make sense to separate that CSS out so the user only takes the exra hit when they go to those particular pages.

1 Like

thanks for that information