Calling different stylesheets when needed

  • Started
  • Last post
  • 2 Responses
  • laboboy

    Hey guys,

    Does anyone know if its possible to call a stylesheet only when its needed? For example, I have one global stylesheet i want to use throughout the site and then several other stylesheets. I want it so that when you go on a page , it only calls that stylesheet if it contains a style from it. and if it doesnt, it wont call it. So i dont have to put all my styles into one big css file. Anyone have any links where i can read more about this?

  • kyl30

    just call the specific sheet when you need it on a page. don't think you can do it automatically though.

  • joyride0

    javascript could detect the page, and then attach the correct css for it. But I would just make 2 style sheets. on global with all common styles and one specific for each page. But try to use the global stuff more... otherwise css is more of a pain, you might as well do it inline on the page rather then linking