SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2001
    Location
    Denver, CO
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Converting CSS for older browsers

    Right now, I use CSS 2 that validates completely. Newer browsers have no problem with it.

    However, older ones, like the infamous NE 4.x, screw it up. Mainly with the div positioning - I have a right and left column set to absolute and a center div that is fluid. NE 4.x and other old browsers like IE 4.x fail to position the divs - in fact, they don't seem to recognize them at all.

    What I thought I'd do is create a style sheet just for them. Then, I will call the newer sheet via @import, which Netscape 4.x, IE 4.x, and (hopefully) WebTV don't recognize. That way new browsers use the new style and old ones...you get it.

    Anyway, are there any tools around that will help me convert my existing style sheet to one that works with older browsers? I've tried TopStyle, but maybe I'm missing an option. Or, could somebody look at my style sheet and point out what's screwing up the old browsers? Maybe it's something simple?

    Site is www.maximumgamer.com and the style sheet is /mg1280new.css or /mg1024new.css if you are using a screen resolution of 1024x768 or smaller.

    Thank you!

  2. #2
    Gone!
    Join Date
    Aug 2001
    Location
    Witty Location Parody
    Posts
    3,889
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check out:

    http://www.pinkgoblin.com/index.php?view=scripts

    THe first one on that page lets you take your existing CSS and produce a css file for each browser etc and a browser detection function in order that your pages uses the right one.

    Very very handy.

    Glen

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2001
    Location
    Denver, CO
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This looks like the perfect program, but perhaps I am retarded - when I input my style sheet, it spits out 6 different copies for different browser types - but they are all exactly the same. I even fired up Beyond Compare to check. Am I missing something?
    Ixian.

  4. #4
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    From the horse's mouth ...

    Basically the general explaination is here. php CSS Generator follows on from this article at PHP Builder on how to get style sheets to produce the same results in all browsers.

    Although the 6 style sheets you saw look similar, there are small differences, for example the font sizes - the different browsers out there display the same CSS font size in different sizes (e.g. "font-size: medium" will look bigger in Netscape 4.x than in IE 5.5).

    The idea behind php CSS Generator is there are "groups" of browser / Operating system, which will handle style sheets in the same way, so we want 6 style sheets which have small differences to suit each group, and we give the right one to a visitor depending on what browser we detect.

    If you any specific questions, feel free to fire away.


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
  •