如何根据屏幕比例而不是像素中的屏幕分辨率来设置Bootstrap响应?

时间:2017-04-24 13:30:59

标签: html css layout twitter-bootstrap-3

当视口高度大于视口宽度时,我希望将两列堆叠成一列。据我所知col-xx-xx基于像素的屏幕分辨率。我已经为两个单元格尝试了col-sm-6 col-xs-12,但这不是解决方案。

解决方案是什么?

enter image description here

1 个答案:

答案 0 :(得分:0)

I asked the same question in Reddit here, https://www.reddit.com/r/webdev/comments/6799m7/how_can_you_have_bootstrap_responsiveness_based/.

Basically the solution is to merge the view based on landscape or portrait.

@media screen and (orientation: portrait){
    //css
}
@media screen and (orientation: landscape){
    //css    
}