Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2005
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Multiple Style sheets (or disabling a sheet)

    Is there any way to use one style sheet for part of a page and another for the rest?

    Specifically I have an include (SSI) for a header that I want to use a different CSS than for the rest of the document.

    It would be nice to be able to "disable" a style sheet in other circumstances too. I'm guessing the answer is "no" since my google searches have not turned up anything.

  • #2
    Regular Coder
    Join Date
    May 2004
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Elfboy,

    if you put the contents of your header in a <div id="header"> and the rest of your page in a <div id="content"> you can write your CSS like this:

    #header {background:black;color:white;}
    #header h1 {}
    #header p {}
    #header a:link {}
    etc.

    and for the contents:

    #content {background:white;color:black;}
    #content p {}
    #content p span {}
    #content a:link {}
    and so on.

    You can put the CSS in one stylesheet (better) or use two @import statements or two links to include them.

    Disabling a stylesheet is possible with a little JavaScript.
    http://www.quirksmode.org/js/cssdisable.html

  • #3
    New Coder
    Join Date
    Jun 2005
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks SPAN!
    I think the first part is just what I'm looking for. I'll also look at that javascript, but the others I've seen are "all or nothing".


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •