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

Home Forums CSS Faster CSS!

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
  • #41806

    i have a wordpress site with a lot of pages. i have just one style.css file. so i think this could be time consuming for loading every page because everypage has to load styles of all pages that doesn’t need! .so can i have a separate css file for every separate page? i mean a file with style of header and footer and other files for styling page contents. is this useful for speed?
    if it is useful how can i do this?


    any help?!


    It’s better to have all your styles in one CSS, the more css files you have, the more HTTP requests your site has to make. The same goes for your javascript files. Here’s a great video by Chris to help with improving site performance: []( “”)


    thanks a lot @Bonzai . that was what i wanted to know.


    @mostafaghanbari, its depends, if you have a big css for another section (another page) of the site maybe you should put on a separated file, if the user ever hits that section that stylesheet is loaded, but if not they don’t need to load.

    If isn’t so big just shove all on the same CSS.

    Besides that try to use caching as viewed on Screencast [#114: Let’s Do Simple Stuff to Make Our Websites Faster]( quoted from @Bonzai and if needed [ – WHAT ABOUT LOADING CSS?](


    @ChrisP great article but no CodeKit in windows :(


    @jurotek, very useful. i never heard of that! thanks


    @ooredroxoo, i’m designing a forum for myself and trying to separate all things from together. because of this it doesn’t matter the css is big or not, it **must** be separate! but i have a problem. the only way i know is using tag but its in header section of wordpress site. how can i say if for example “contact page” in active, bring “contactpage.css” file?!


    I mean the size based on the requests, if somewhere on the road you end up with too much css loading on a single page, and they are not so big you can merge them to avoid some http connections on your site, and avoid repeating styles between pages.

    By separate the CSS I mean that you will end up with two o more files, and need reference them by link.

    The requirejs can be helpful to load dynamic after the initial load on the page, say you use ajax, you can then require the css for that section.


    yes as you said the answer is requestJS! but i think for avoiding multiple server requests its better to have all things in one place. thanks any way @ooredroxoo.

Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘CSS’ is closed to new topics and replies.