Sven Fäßler: Verschiedene Auflösungen, versch. CSS Datei wählen

Beitrag lesen

Hallo,
ich will je nach Auflösung des Bildshcirmes versch. CSS Dateien wählen, bei mir geht es eingeschränkt, wenn ich 1024 eingesetellt habe, geht es, bei 800x600 jedoch nicht. jemand eine idee?

Gruß
Sven
------
<html>
<head>
<title>Auflösungs-Auswahl Infos24</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="Javascript">

if ( screen.width == 800 )
{
 document.write('<link rel="stylesheet" href="800.css" type ="text/css">');
}

else if ( screen.width == 1024 )
{
 document.write('<link rel="stylesheet" href="1024.css" type ="text/css">');
}

else

{
 document.write('<link rel="stylesheet" href="./sonstige.css" type ="text/css">');
}

</script>

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