[thelist] Media-specific Stylesheets

Arlen.P.Walker at jci.com Arlen.P.Walker at jci.com
Tue Jul 16 16:08:01 CDT 2002


> If I have a
>HTML file, how do I send it with a different CSS stylesheet? Does it have
to be
>through Javascript or CGI scripts that go in there and change the <link>
or
><?xml-stylesheet?> tags?

<link rel="stylesheet" type="text/css" media="print" > will create a style
sheet that only is used when printing.

You can also designate a section of a 'media="all" ' stylesheet to
specific media by using the @media command. The syntax is @media medianame
{...} and everything between the braces is applied for the given media
named in medianame. You can use several media names separated by commas if
you like. NOTE: This particular syntax isn't recognized in all browsers.
This isn't necessarily a problem, as it means @media can also be used to
hide good CSS from some bad browsers.

Have fun,
Arlen
Chief Managing Director In Charge, Department of Redundancy Department
DNRC 224

Arlen.P.Walker at JCI.Com
----------------------------------------------
In God we trust; all others must provide data.
----------------------------------------------
Opinions expressed are mine and mine alone.
If JCI had an opinion on this, they'd hire someone else to deliver it.



More information about the thelist mailing list