If that's all you want, use conditional comments:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!--[if IE]>
<link rel="stylesheet" href="ie.css" type="text/css">
<![endif]-->
<!--[if !IE]> <-->
<link rel="stylesheet" href="all_others.css" type="text/css">
<!--> <![endif]-->
</head>
<body>
</body>
</html>
No javascript required.
However, there is a better way. The above is mutually exclusionary. IE gets one stylesheet, all others get another. Much duplication is likely between the two stylesheets. If you do it like so:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="main.css" type="text/css">
<!--[if IE]>
<link rel="stylesheet" href="ie.css" type="text/css">
<![endif]-->
</head>
<body>
</body>
</html>
then both IE and all others will get the main stylesheet. Only IE will get the ie.css, which will only need to have things in it that are different than the main styles.
Bookmarks