2

The css written inside @media print and (orientation:portrait){} media query is not working at all in safari web browser.But its working fine in chrome. And @media print and (orientation:landscape){} is working perfectly in both safari and chrome.

I m currently using this css

/* For Portrait */
@media print and (orientation:portrait){
  #upperSample {
      width: 91%;
        height: 93px;
        overflow: hidden;
        position: relative;
        border: 0px solid lime;
        margin-left: -13px;
    }

   #upperSample img {
        position: absolute;
        top: 0px;
        left: -0px;
    }

   #lowerSample {
         border: 0 solid orange;
        clear: left;
        height: 190px;
        margin: -85px 0 0 143px;
        overflow: hidden;
        position: relative;
        width: 91%;
    }
   #lowerSample img {
        left: 0;
        position: absolute;
        top: -95px;
    }
} 
halfer
  • 19,824
  • 17
  • 99
  • 186
Soojoo
  • 2,146
  • 1
  • 30
  • 56
  • What version of Safari are you using? – Kaspar Lee Dec 07 '15 at 11:19
  • I'm having a similar issue. Safari 7.1.7 is ignoring portrait and using the styles from the landscape media query. I've created a jsfiddle which I believe reproduces this at a very basic level: https://jsfiddle.net/545kx8xu/ Initially, it looks to be a Safari bug but more investigation is needed... – R Brill Dec 17 '15 at 09:27
  • @SujathanR It might help if you provide some html in order for us to help with possible answers or workarounds for what appears to be a Safari bug. – R Brill Dec 17 '15 at 15:24
  • There is another example in http://stackoverflow.com/questions/38162893/javascript-window-print-dialog-does-not-respect-mediaqueries-in-safari-9-1-el – gabel Jul 04 '16 at 14:25

0 Answers0