How to use @media print and @page?

  • Profile Image
    MediaMouth
    Asked on December 01, 2020 at 10:42 AM

    I've yet to see @media print and @page do anything on Mac OS Safari, Chrome or Firefox. My impression is that these CSS features are no longer supported?



    This is a re-post of a comment on CSS: The Perfect Print Stylesheet

  • Profile Image
    Bojan_J
    Answered on December 01, 2020 at 12:02 PM

    Greetings.

    This functionality is still available. I have tested it in Chrome and Firefox, and I had no problems with it. Please note that these will be applied only when printing the page:

    screenshot_3000.png

    This page is using the following HTML:

    <html>
    <head>
    <title>Test</title>
    <style>
    @media print { 
    body {
    color: red;
    }
    }
    </style>
    </head>
    <body>
    <h1>Some Text</h1>
    </body>
    </html>

    Let us know if you have any additional questions.