SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Evangelist ktown's Avatar
    Join Date
    May 2001
    Location
    toronto
    Posts
    478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    different stylesheets for EI & NS

    hello everyone.
    i was wondering...

    how difficult is it to have 2 different stylesheets? one for EI, Opera. and another for the netscape browsers?

    i've never done this before - i guess i would have to have a browser detector on my index page??

    could anyone direct me to a tutorial of some sort - or if its quick just give me the code to put on my pages?

    thanks a lot

  2. #2
    American't awestmoreland's Avatar
    Join Date
    Sep 2002
    Location
    Grand Rapids, MI
    Posts
    1,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    From the English nation to a US location.

  3. #3
    SitePoint Member
    Join Date
    Jan 2003
    Location
    Sheffield, UK
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: different stylesheets for EI & NS

    Originally posted by ktown

    i've never done this before - i guess i would have to have a browser detector on my index page??

    could anyone direct me to a tutorial of some sort - or if its quick just give me the code to put on my pages?
    There are several ways of dealing with this. One of them is to put some JS code in the header of each page so that the imported CSS is decided on the fly. I do that on my test site http://skint.shef.ac.uk.
    Another way would be to sniff out the UA (User Agent aka Browser) string from the server side using PHP or CGIs or somesuch.
    Both these techniques are not particularly succesful in a number of situations (for example, Opera and Mozilla can change the UA string, hence your test is useless). The best practice (as far as I am aware. See http://groups.google.com/groups?dq=&...rnsc02&rnum=0) is to incrementally have CSS that adapt to the limitations on your site. From that thread:
    1.- A simple layout for CSS browsers is used (again, see my site: only H1, H2... P and UL)
    2.- A simple CSS that is compatible with NN4 is linked.
    3.- The CSS for IE+Gecko(Mozilla, NN6+...) is then @imported.
    4.- Different tips can be used to separate between IE and Gecko.

    This is quite of a hassle, but it is guaranteed to work :-)

  4. #4
    SitePoint Evangelist ktown's Avatar
    Join Date
    May 2001
    Location
    toronto
    Posts
    478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you both
    i will look into it - and probably come back with problems - hehe...
    yeah - just because the whole NS4 is pretty dumb with my stylesheet. its so confused. thanks again
    ~nina.

  5. #5
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just make sure you don't feed Netscape 6/7 and Mozilla the same style sheet as NN4. Completely different rendering engines.

    N6/N7/Mozilla should handle the IE/Opera style sheet without any problems.

  6. #6
    SitePoint Evangelist ktown's Avatar
    Join Date
    May 2001
    Location
    toronto
    Posts
    478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah i figured out the @import option

    there is this great site someone directed me to
    http://www.mako4css.com/csstwo.htm

    for anyone who is curious about it

    thanks again.


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
  •