Web Hosting Forum - Explore the Latest in Web Hosting Discussions

We are a community of individuals and businesses passionate about web hosting. Let's build, learn, and grow together.

how many CSS sheets allowed for a site?

fulton

Newbie
Registered
Hello,

I could see that some only used a CSS sheet for their entire site. I wonder if it's not "risky" to do that (for example, use the same id multiple times) ... And so what would be the best solution between:

- use a single CSS sheet for the entire site

- use a CSS sheet per HTML page

- or do both (use a CSS sheet common to the whole site that groups elements that always come back, such as the header, the nav, the title, the logo, footer, etc. AND use a CSS sheet specific to each page for everything else ?

While waiting for your opinions ...
 
Using a style sheet per page would slow down the loading speed of your pages, instead use a single sheet and separate each part with comments

Use the id in case the element is unique and strictly no other situation, otherwise use classes.
 
  • Advertisement
  • Ok, thanks for your opinion! it reassures me, it makes things much easier! And I must confess that I had great doubts, because on many sites there are dozens of style sheets.
     
    A web app with a global set of design patterns, and then lesser-used design patterns on different sections of the site.
    Content heavy site with a global set of structure, grid and typography and then additional CSS loaded for specific sections of site that need more.
    Sites where every page is very unique (global and page-specific CSS).
    Most sites.
     
  • Advertisement
  • I would say I average 2-3 CSS files per page. Keep in mind with CSS, it's cascading style sheets, meaning that if I have 3 style sheets linked on a page, make sure you understand how the styles cascade down, or you may get some unexpected results. Each web page doesn't need its own stylesheet.

    Regards,
    Lewis
     

    Advertisement

    Back
    Top