Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it good idea to make separate CSS file for each HTML page?

Tags:

html

css

web

I am building a personal homepage. I have 4 HTML pages and only one CSS sheet linked for all of the pages. That is, inside a single CSS file I have set up layout for all different pages. [In fact, each page has pretty much the same layout, only the contents and their style looks different. And my website isnt that advance.]

Is it a good practice? Or I should create separate CSS for each page?

An example of that what I have done:

page-1.html:

<link rel="stylesheet" type="text/css" href="design.css">

page-2.html:

<link rel="stylesheet" type="text/css" href="design.css">

design.css:

/*
.......
*/
like image 879
Esha Avatar asked May 31 '15 13:05

Esha


Video Answer


1 Answers

Just have 1 css file for something so small. When you get into building larger sites you can split your style sheets up into modules.

Have a read through the Scalable and Modular Architecture for CSS approach as it's a solid way of thinking before you get to a level where you can build out your own css architecture.

like image 97
Joshua Kelly Avatar answered Sep 22 '22 20:09

Joshua Kelly