CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 6th, 2001, 02:58 PM
Darcangelo Darcangelo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: Stockholm
Posts: 1 Darcangelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Darcangelo
Question Re-direct browser for different CSS?

Hello,

I want to do a webpage that will have two stylesheets, one for IE browsers and the other for Netscape browser. How can I do this with two different .css files?

I would like the browser to re-direct the user according to their browser.

thanks in advice!

/D'arcangelo

Reply With Quote
  #2  
Old July 6th, 2001, 06:10 PM
adios adios is offline
Senior Citizen
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2001
Location: leftcoast
Posts: 2,019 adios User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 10
It's not a redirect; you just need to link the page to the appropriate .css file. Here's one way:
______________________________________________________________________________________
<html>
<head><title>untitled</title>

<script language="Javascript" type="text/javascript">

var b = document.layers ? 'NS4' : document.all ? 'IE' :
document.getElementById && !document.all ? 'NS6' : 'default';

document.write('<LINK rel="stylesheet" type="text/css" href="'+ b + '_style.css">');

</script>

This will read into the document a .css file named "NS4_style.css" (or "IE_style.css"/"NS6_style.css"/"default_style.css") as needed. Change the filenames as desired. You can get much more granular (discriminating) with this - detect Mac platforms as well - but this is the basic principle.

http://www.richinstyle.com/mastercl...ossbrowser.html

Last edited by adios : July 7th, 2001 at 07:54 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Re-direct browser for different CSS?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway