SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard bronze trophy cydewaze's Avatar
    Join Date
    Jan 2006
    Location
    Merry Land, USA
    Posts
    1,096
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    My CSS is getting out of hand

    I have a website with a fairly extensive (to me, at least) stylesheet, and to make matters worse, I have three alternate stylesheets that a user can switch between. Thus, whenever I make a change to something, I have to make that change four times.

    Since all four stylesheets use pretty much the same positioning, I recently had the idea to seperate all the positioning stuff into one sheet, and leave the color and text styles in the four switchable sheets (maybe using @import).

    But, I don't know if this is possible, since it would mean that I'd have duplicate #id definitions (one in the main stylesheet and one in the @imported one). Does this sound do-able, or will I run into problems? Is there another way to do this? Is it even something I should be considering?

  2. #2
    SitePoint Addict
    Join Date
    Mar 2005
    Posts
    239
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It is possible, and some people would support the idea. I don't do it because my stylesheets never get that big (almost though!).

    In your case I would recommend it. CSS should allow you to make sitewide changes easily and if you are have to repeat changes on different sheets then it's not working.

    I believe you just link to 2 separate sheets and make sure that one has only position, and the other (others in your case) have all the visual stylings.

  3. #3
    SitePoint Wizard bronze trophy cydewaze's Avatar
    Join Date
    Jan 2006
    Location
    Merry Land, USA
    Posts
    1,096
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SubEffect
    I believe you just link to 2 separate sheets and make sure that one has only position, and the other (others in your case) have all the visual stylings.
    And it's ok that both the sheets I link to have a #nav?

  4. #4
    SitePoint Addict
    Join Date
    Mar 2005
    Posts
    239
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I think so. But the second one to be linked to will override the 1st one where the same things are defined. I think Sitepoint might even have an article on it, or there might be a thread on this already. Search, and test it out. Let us know what happens


Bookmarks

Posting Permissions

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