html - 请帮助澄清方向 :portrait behavior in CSS

标签 html css media-queries

根据 https://developer.mozilla.org/en-US/docs/Web/CSS/@import ,

list-of-media-queries is a comma-separated list of media queries conditioning the application of the css rules defined in the linked url. If the browser doesn't support any of these media types, it won't even load the linked resource.

所以我想知道的是,如果我有:

@import url('portrait.css') screen and (orientation:portrait);

这是否意味着如果或何时我在台式电脑上调整网络浏览器的宽度,使宽度小于网络浏览器的高度,portrait.css 文件将覆盖当前风格?

或者如果视口(viewport)宽度已经小于它的高度,它是否仅在页面加载时加载 portrait.css 文件

最佳答案

http://www.hongkiat.com/blog/css-orientation-styles/

@media all and (orientation:portrait) {  
    /* Styles for Portrait screen */  
}  
@media all and (orientation:landscape) {  
    /* Styles for Landscape screen */  
}  

所以每当宽度小于高度时,这将是一个肖像,最终将加载您的 css 文件,即使原始屏幕初始化为横向。

关于html - 请帮助澄清方向 :portrait behavior in CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23691836/

相关文章:

html - 框中的按钮和可调整大小的文本

javascript - 更改滚动到视口(viewport)时的事件状态

css - 在顺序媒体查询中使用最大宽度和最小宽度的优点?

css - 如何水平对齐平板电脑布局的元素?

html - 使用媒体查询获得完美图像响应的正确方法是什么?

javascript - 通过视口(viewport)检测到 div 时的动画效果

html - 如何更改嵌套列表项的 CSS 样式?

css - ie9 spacing - css 无法正常工作

html - 如何使用 CSS 背景位置使图像在 img 标签中居中

html - 小图片链接作为其销售图片右下角的按钮