0

I am new to css and i want to check for page orientation while printing I wrote this code but it's not working

        @media print {
            /* if the page orientation is landscape */
            @media (orientation: landscape) {
                .card {
                    background-color: 'green';
                }
            }

            /* else if the page orientation is portrait*/

            @media (orientation: portrait) {
                .card {
                    background-color: 'yellow';
                }
            }
        }
Mohammad Edris Raufi
  • 1,393
  • 1
  • 13
  • 34

0 Answers0