[css] Media-tags for dynamicly included css

Last post 03-02-2007 6:16 AM by Cryothic. 2 replies.

Sort Posts:

  • [css] Media-tags for dynamicly included css

    03-02-2007, 3:52 AM
    • Loading...
    • Cryothic
    • Joined on 03-10-2006, 9:27 AM
    • Posts 8

    Hi,

    I want to have a different css file for printing the pages.
    So I've added a css link to the masterpage, with the media="print" tag.

    The problem is that the css files included through themes don't have this tag (media="screen").
    And since they don't have a media-tag, they are all included when printing.

    Is there any way I can add the media-tag to the dynamicly added css files?

    Thanks in advance,
    Cryothic

    Filed under: ,
  • Re: [css] Media-tags for dynamicly included css

    03-02-2007, 5:31 AM
    Answer
    • Loading...
    • michielvoo
    • Joined on 02-11-2007, 2:52 PM
    • Rotterdam
    • Posts 166

    Hello,

    you can use an @media block in the stylesheet. It's not a great solution, because all stylesheets still get linked. But only the rules in the right @media block are used depending on the media.

    Good luck! 

    When you have asked a question, remember to click "Mark as answered" for a reply that answered your question. This ensures the right forum member gets credits (and it makes search more relevant too).
  • Re: [css] Media-tags for dynamicly included css

    03-02-2007, 6:16 AM
    • Loading...
    • Cryothic
    • Joined on 03-10-2006, 9:27 AM
    • Posts 8

    That could be a solution, but with a lot of css files there is still a lot of work to do.

    Isn't there a generic .net solution?

Page 1 of 1 (3 items)
Microsoft Communities
Page view counter