首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Safari忽略媒体查询画像

Safari忽略媒体查询画像
EN

Stack Overflow用户
提问于 2016-10-10 11:54:18
回答 1查看 545关注 0票数 1

我正在不同的浏览器上测试我的代码。我看到Safari (Mac上的版本9)完全忽略了媒体对方向画像的查询。

这是一个代码:

代码语言:javascript
复制
@media print  and  (orientation:landscape) and (-webkit-min-device-pixel-ratio:0){
  // Hide the default headers and footers that the browser adds

  .no-print-portrait {
    display: block;
  }
  .portrait-notification {
    display:none;
  }
}

// If the orientation is in portrait it hides all html and displays a notification to the user to switch to landscape

@media print  and  (orientation:portrait) and (-webkit-min-device-pixel-ratio:0){

 // Hide the default headers and footers that the browser adds
  @page {
    margin: 0;
  }

  .no-print-portrait {
    display: none;
  }

  .portrait-notification {
    display: block !important;
    font-size: 24px;
    padding-left: 8px;
    padding-top: 20px;
    text-align: center;
  }
}

有人知道为什么吗?

非常感谢!

EN

回答 1

Stack Overflow用户

发布于 2016-10-11 09:35:35

由于文档的原因,Safari不支持这一点

代码语言:javascript
复制
http://caniuse.com/#search=print
and/or
https://developer.mozilla.org/en-US/docs/Web/CSS/@page
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39951095

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档