Print Style Sheets and ASP.Net Themes

I’ve been researching printable style sheets, and came up with an issue on Terralever.com. How to make the theme stylesheets have a media type!

So I did some side research and came up with the most common answer out there: set an @media type in the css file itself. Read an article regarding @media type.

There was also an interesting article by the same author regarding how to define a particular load order.

This works GREAT for print stylesheets, but what about when we want to do IE6 specific styles? What then! If you’ll notice, when you set a theme, the stylesheet it populates at the end of the header tag, which would overwrite any specific stylesheets we would reference above it.

If we declare themes in the @ page declaration using StyleSheetTheme instead of just Theme the document is then populated with the css stylesheets at the beginning of the head declaration instead of at then end. More information regarding this and other theme and skin information. This would allow us to create javascript that would check for browser type/version and specify additional stylesheets for these versions if required.

1 Comment to “Print Style Sheets and ASP.Net Themes”

  • Have you looked into Microsoft Conditional Comments (http://msdn2.microsoft.com/en-us/library/ms537512.aspx)? Using conditional comments you can define IE specific style sheets, however conditional comments don’t jive with Themes very well. Usually we have to define them manually in the document’s head. There are a couple of other approaches like: using an aspx file in a style sheet link, to determine the browser type and serve up your browser specific styles, or stop depending on Themes to load style sheets.

Leave a comment

What is this?

This little blog happens to be the personal ramblings of one April Holle - I'm female, outspoken, webbie, a community evangelist, and Principal of Made Better Studio. Check out the about section for more info.

What People Are Saying…