October 09, 2008

Print Stylesheet in ASP.NET Themes

Last post I talked about ASP.NET Themes -- all CSS files in the theme folder will be loaded, no matter what. This makes having a matching print stylesheet a little difficult since you can't specify media types for you theme stylesheets.

Enter the @media tag. In your print.css stylesheet, you can use this tag to specify your media type in the stylsheet instead of in the <link> tag as you normally would.


@media Print 
{
	body,a {color:#000;}
}

And as an added bonus: this even works in IE 6. Who would have thought?

1 of 1

Who?

Howdy. I'm Richard W. Baker - a designer based in Jacksonville, Florida with a passion for information architecture and usable interfaces. At my day job, I work for the City of Jacksonville as a User Interface Designer.

If you still have questions, or you're interested in hiring me for your next project, .

Active ingredients: XHTML + CSS + Expression Engine
Page rendered in 0.1902 seconds  |  50 SQL queries total