Media query for Print portrait view not working in

2019-02-19 12:01发布

问题:

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;
    }
}