On 02/03/2012 00:40, Ben Zeller wrote:
Hi everyone,
On a recent project we've decided to combine our @print media styles at the
bottom of our main stylesheet. eg.
@media print { /* Print styles */}
In our global template, the stylesheet is imported with the media attribute
"screen". Using this attribute, the print styles are ignored.
<link rel="stylesheet" href="css/style.css" media="screen">
Logically. You're saying that those styles only apply to the screen
media type. The fact that you then have definition for styles for print
in there is irrelevant, as the browser won't look at those styles in the
first place as you specifically said it's only for screen.
The following markup options offer a solution to the problem:
1. <link rel="stylesheet" href="css/style.css">
2. <link rel="stylesheet" href="css/style.css" media="all">
I guess the question I have is whether there are any caveats with either
method, and if there is a best practice solution?
The doc type is XHTML 1.0 Transitional if this is relevant.
No adverse effect using 1 (which, without media attribute, implicitly
means "all") or 2. Of course, the styles then also take effect on, say,
"projection" media type etc, but apart from Opera when in full-screen
mode, I don't think any other browser uses it (and you probably DO want
your styles to also apply there).
P
--
Patrick H. Lauke
______________________________________________________________
re·dux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]
www.splintered.co.uk | www.photographia.co.uk
http://redux.deviantart.com | http://flickr.com/photos/redux/
______________________________________________________________
twitter: @patrick_h_lauke | skype: patrick_h_lauke
______________________________________________________________
*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
*******************************************************************