html - Bootstrap Media queries Orientation Change to Landscape 在物理设备下不起作用

标签 html twitter-bootstrap css responsive-design

我在 Bootstrap 中面临一个非常奇怪的问题,基本上我有这个页面 http://excellencewebworks.com/bootstrap/video_skin.html

我在这里添加了覆盖有平板电脑视频皮肤的视频。当我在 Mozilla Firefox -> Tools-> Responsive Design View for 360 x 640 dimension 响应模式下检查页面时,它在纵向和横向模式下运行良好。

但是当在物理设备上检查同一个页面时,它只适用于纵向而不是横向,设计在横向模式下会发生变化。看到这个很奇怪。

任何人都可以调查一下并让我知道我在这里做错了什么吗?

谢谢, 罗纳克沙阿

最佳答案

这是横向和纵向模式媒体查询的代码,试试这个。

/* ----------- iPhone 4 and 4S ----------- */

/* Portrait and Landscape */
@media only screen 
  and (min-device-width: 320px) 
  and (max-device-width: 480px)
  and (-webkit-min-device-pixel-ratio: 2) {

}

/* Portrait */
@media only screen 
  and (min-device-width: 320px) 
  and (max-device-width: 480px)
  and (-webkit-min-device-pixel-ratio: 2)
  and (orientation: portrait) {
}

/* Landscape */
@media only screen 
  and (min-device-width: 320px) 
  and (max-device-width: 480px)
  and (-webkit-min-device-pixel-ratio: 2)
  and (orientation: landscape) {

}

/* ----------- iPhone 5 and 5S ----------- */

/* Portrait and Landscape */
@media only screen 
  and (min-device-width: 320px) 
  and (max-device-width: 568px)
  and (-webkit-min-device-pixel-ratio: 2) {

}

/* Portrait */
@media only screen 
  and (min-device-width: 320px) 
  and (max-device-width: 568px)
  and (-webkit-min-device-pixel-ratio: 2)
  and (orientation: portrait) {
}

/* Landscape */
@media only screen 
  and (min-device-width: 320px) 
  and (max-device-width: 568px)
  and (-webkit-min-device-pixel-ratio: 2)
  and (orientation: landscape) {

}

/* ----------- iPhone 6 ----------- */

/* Portrait and Landscape */
@media only screen 
  and (min-device-width: 375px) 
  and (max-device-width: 667px) 
  and (-webkit-min-device-pixel-ratio: 2) { 

}

/* Portrait */
@media only screen 
  and (min-device-width: 375px) 
  and (max-device-width: 667px) 
  and (-webkit-min-device-pixel-ratio: 2)
  and (orientation: portrait) { 

}

/* Landscape */
@media only screen 
  and (min-device-width: 375px) 
  and (max-device-width: 667px) 
  and (-webkit-min-device-pixel-ratio: 2)
  and (orientation: landscape) { 

}

/* ----------- iPhone 6+ ----------- */

/* Portrait and Landscape */
@media only screen 
  and (min-device-width: 414px) 
  and (max-device-width: 736px) 
  and (-webkit-min-device-pixel-ratio: 3) { 

}

/* Portrait */
@media only screen 
  and (min-device-width: 414px) 
  and (max-device-width: 736px) 
  and (-webkit-min-device-pixel-ratio: 3)
  and (orientation: portrait) { 

}

/* Landscape */
@media only screen 
  and (min-device-width: 414px) 
  and (max-device-width: 736px) 
  and (-webkit-min-device-pixel-ratio: 3)
  and (orientation: landscape) { 

}

关于html - Bootstrap Media queries Orientation Change to Landscape 在物理设备下不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32817666/

相关文章:

html - float 和媒体查询在 IE 中不起作用

html - 为特定组件启用滚动

javascript - $ ("a[rel=popover]").popover 不是函数

javascript - 获取类设置为col-md-7但未设置宽度的div的宽度

css - IE 11/12 border-radius 1px 错误

css - Bootstrap col-md-4 h2 不以移动设备为中心

css - 使用 webpack + css 组件时导入 vendor css

html - 如果我将表格用于 html 表单,SEO 会发生什么情况?

javascript - 带图像的 HTML/CSS 模态对话框(Sweetalert 或其他)

jquery - Django 表单未显示在 Bootstrap 模式中