469,573 Members | 1,706 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,573 developers. It's quick & easy.

Wired CSS XHTML

Just had a look at the Wired.com site and it seems it's completely in
XHTML and CSS. I don't understand this snippet of code on their
homepage, though:

<link rel="stylesheet" type="text/css" media="screen"
href="http://a1112.g.akamai.net/7/1112/492/2002091447/www.wired.com/news/v/20020914/css/cs4/wnScreen.css"
/>
<link rel="stylesheet" type="text/css" media="aural,braille,embossed"
href="http://a1112.g.akamai.net/7/1112/492/2002091447/www.wired.com/news/v/20020914/css/wnOther.css"
/>
<link rel="stylesheet" type="text/css" media="print"
href="http://a1112.g.akamai.net/7/1112/492/2002091447/www.wired.com/news/v/20020914/css/wnPrint.css"
/>
<link rel="alternate stylesheet" type="text/css" media="screen,print"
href="http://a1112.g.akamai.net/7/1112/492/2002091447/www.wired.com/news/v/20020914/css/wnSm.css"
title="Small Text" />
<link rel="alternate stylesheet" type="text/css" media="screen,print"
href="http://a1112.g.akamai.net/7/1112/492/2002091447/www.wired.com/news/v/20020914/css/wnLg.css"
title="Large Text" />
<link rel="alternate stylesheet" type="text/css" media="screen,print"
href="http://a1112.g.akamai.net/7/1112/492/2002091447/www.wired.com/news/v/20020914/css/wnLg2.css"
title="Larger Text" />
</head>

<body id="LMR" onload="setStyle();" >

How do they detect the Media visiting the site. Isn't CSS/XHTML
supposed to detect this by itself, why do they need Javascript? Anyone
care to explain? Thanks!
Jul 20 '05 #1
1 2851
Jocab wrote:
Just had a look at the Wired.com site and it seems it's completely in
XHTML and CSS. I don't understand this snippet of code on their
homepage, though:

<link rel="stylesheet" type="text/css" media="screen"
href="http://a1112.g.akamai.net/7/1112/492/2002091447/www.wired.com/news/v/20020914/css/cs4/wnScreen.css"
/>
<link rel="stylesheet" type="text/css" media="aural,braille,embossed"
href="http://a1112.g.akamai.net/7/1112/492/2002091447/www.wired.com/news/v/20020914/css/wnOther.css"
/>
<link rel="stylesheet" type="text/css" media="print"
href="http://a1112.g.akamai.net/7/1112/492/2002091447/www.wired.com/news/v/20020914/css/wnPrint.css"
/>
<link rel="alternate stylesheet" type="text/css" media="screen,print"
href="http://a1112.g.akamai.net/7/1112/492/2002091447/www.wired.com/news/v/20020914/css/wnSm.css"
title="Small Text" />
<link rel="alternate stylesheet" type="text/css" media="screen,print"
href="http://a1112.g.akamai.net/7/1112/492/2002091447/www.wired.com/news/v/20020914/css/wnLg.css"
title="Large Text" />
<link rel="alternate stylesheet" type="text/css" media="screen,print"
href="http://a1112.g.akamai.net/7/1112/492/2002091447/www.wired.com/news/v/20020914/css/wnLg2.css"
title="Larger Text" />
</head>

<body id="LMR" onload="setStyle();" >

How do they detect the Media visiting the site.
They don't.

Isn't CSS/XHTML supposed to detect this by itself, why do
they need Javascript?


Not CSS/XHTML - it's the browser/User Agent that is supposed to get the
stylesheet for its media type.

And the browser should make alternate stylesheets for the supported
media type available to the user, in this case the "Small Text", Large
Text" and "Larger Text". Some browsers don't do that, so the Javascript
is kinda a workaround for that, in combination with the "Text Size"
feature in the right part of the green bar; additionally it saves the
preferred stylesheet in a cookie.
Matthias

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Peter Rohleder | last post: by
3 posts views Thread by HTML-JSClub | last post: by
32 posts views Thread by jp29 | last post: by
16 posts views Thread by Mcginkel | last post: by
2 posts views Thread by Joris Janssens | last post: by
12 posts views Thread by Alex D. | last post: by
6 posts views Thread by dmcglynn | last post: by
reply views Thread by Terry Reedy | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.