By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,785 Members | 1,079 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,785 IT Pros & Developers. It's quick & easy.

Wired CSS XHTML

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.