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


i building personal homepage. have 4 html pages , 1 css sheet linked of pages. is, inside single css file have set layout different pages. [in fact, each page has pretty same layout, contents , style looks different. , website isnt advance.]

is practice? or should create separate css each page?

an example of 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:

/* ....... */ 

your example shows using 1 design.css file entire website.

generally, better have 1 single .css file containing data pages 2 reasons:

  1. you allow browsers cache .css files resulting in faster loading times;
  2. it ease maintenance process.

i advise you, if want divide .css in separate blocks use css' @import divide blocks of code f.e form styles , on.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -