On Feb 13, 2006, at 6:20 am, hepabolu wrote:

> Summary: the title attribute in a <link> to a CSS file causes Firefox
> and Safari to ignore the print version, while it works fine in IE. And
> IE does not support @import with media indications.
>
> Extended version:
>
> I have an HTML file (XHTML 1.0 Strict) that contains a link to a CSS 
> file:
>
> <link href="theme.css" title="theme.css" rel="stylesheet" 
> type="text/css"/>
>
> This works fine in Safari, Firefox (OS X and Win) and IE6.
>
> After adding the print version:
>
> <link href="theme.css" title="theme.css" rel="stylesheet"
> type="text/css" media="screen"/>
> <link href="theme-print.css" title="theme-print.css" rel="stylesheet"
> type="text/css" media="print"/>

You have to give the print style-sheet the *same* title as the screen 
style-sheet.
i.e
<link href="theme-blue.css" title="blue" rel="stylesheet" 
type="text/css" media="screen" />
<link href="theme-blue-print.css" title="blue" rel="stylesheet" 
type="text/css" media="print" />

<link rel="alternate stylesheet" type="text/css" href="theme-red.css" 
media="screen" title="red" />
<link rel="alternate stylesheet" type="text/css" 
href="theme-red-print.css" media="print" title="red" />

With the above, a well educated browser will select the 
'theme-blue-print.css' for printing when the 'theme-blue.css' is the 
active screen style (Firefox, Opera, I think Safari but I haven't 
tested this for a while).

The title attribute makes the stylesheet persistent; when used with 
multiple stylesheets, it is also used as a means of grouping the 
stylesheets.

<http://www.w3.org/TR/html401/present/styles.html#h-14.3>

BTW, IE has a truck load of bugs with this (essentially ignoring the 
title attribute.

Philippe
---
Philippe Wittenbergh
<http://emps.l-c-n.com/>

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to