SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot Tygger2512's Avatar
    Join Date
    Jul 2003
    Location
    Pittsburg, KS
    Posts
    191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Clarification on CSS for printing

    When you specify a CSS file to be used when a web page is printed, are you over-riding rules specified in your main CSS file, or are you defining a set of mutually exclusive rules in the two style sheets? i.e. Do the rules you specify in your print CSS file modify the rules specified in your main CSS or is the main CSS file ignored completely when you print in favor of the print rules that you specify?

    Regards,
    Andy.

  2. #2
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    I believe that if you specify the media as print, it should be the exclusive stylesheet.

  3. #3
    SitePoint Addict
    Join Date
    Sep 2003
    Location
    Europe
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you specify media="screen" for your main stylesheet and media="print" for your print stylesheet they are mutually exclusive. But if your main stylesheet is media="all" then your print stylesheet (when linked after the main one) overrides specific rules of your main stylesheet.

  4. #4
    SitePoint Zealot Tygger2512's Avatar
    Join Date
    Jul 2003
    Location
    Pittsburg, KS
    Posts
    191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by yngwin
    If you specify media="screen" for your main stylesheet and media="print" for your print stylesheet they are mutually exclusive. But if your main stylesheet is media="all" then your print stylesheet (when linked after the main one) overrides specific rules of your main stylesheet.
    Thanks for the response. If you link your main stylesheet without specifying the media attribute then I assume the default is media="all" - correct?

    Regards,
    Andy.

  5. #5
    SitePoint Addict
    Join Date
    Sep 2003
    Location
    Europe
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, when unspecified the default value for media is "all".

  6. #6
    Ensure you finish what you sta bronze trophy John Colby's Avatar
    Join Date
    Aug 2003
    Location
    University of Central England, U.K.
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by yngwin
    If you specify media="screen" for your main stylesheet and media="print" for your print stylesheet they are mutually exclusive. But if your main stylesheet is media="all" then your print stylesheet (when linked after the main one) overrides specific rules of your main stylesheet.
    I know I could test for all this, but someone here my already know. What happens when:

    Your main stylesheet is unspecified for media, but you invoke a media="print" stylesheet?

    Your main stylesheet is media="all", does the browser invoke its own print stylesheet invariably? What's supposed to happen? And what does actually happen?

    Your main stylesheet is media="screen", does the browser invoke its own print stylesheet invariably? What's supposed to happen? And what does actually happen?

    Your main stylesheet is unspecified for media. Does the browser invoke its own print stylesheet invariably? What's supposed to happen? And what does actually happen?

    I know the last three are very similar - I'm trying to establish some groundrules for colleagues.
    John
    No electrons were harmed during the creation, transmission
    or reading of this posting. However, many were excited and
    some may have enjoyed the experience.

  7. #7
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    Seattle
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And the real bugger of a question: Do all browsers support this the same way?

  8. #8
    SitePoint Addict
    Join Date
    Sep 2003
    Location
    Europe
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Get testin' then!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •