Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1615 Is it possible to detect the browser and use one of two external style sheets?

irt.org | Knowledge Base | JavaScript | Misc | Q1615 [ previous next ]

Q1615 Is it possible to detect the browser and use one of two external style sheets?

You can do the following:

<html>
<head>
<script language="JavaScript"><!--
if (document.getElementById)
    document.write('<link rel="stylesheet" href="ie5_nn6.css" type="text/css">');
else if (document.layers)
    document.write('<link rel="stylesheet" href="ns4.css" type="text/css">');
else if (document.all)
    document.write('<link rel="stylesheet" href="ie4.css" type="text/css">');
//--></script>
</head>

<body>
...
</body>
</html>

Feedback on 'Q1615 Is it possible to detect the browser and use one of two external style sheets?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.