twitter-bootstrap 响应式布局上的 Twitter Bootstrap 平板电脑尺寸为 1024 而不是 979

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14495070/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 16:10:55  来源:igfitidea点击:

Twitter Bootstrap tablet dimension 1024 not 979 on responsive layout

htmltwitter-bootstrapresponsive-design

提问by Tudor Ravoiu

I do not understand why Twitter Bootstrap is considering the tablet size from 768 to 979, and not from 768 to 1024 (iPad). The problem is that if a client requests a custom design for tablet, that tablet design will not be visible on iPad in landscape mode.

我不明白为什么 Twitter Bootstrap 会考虑从 768 到 979 的平板电脑尺寸,而不是从 768 到 1024(iPad)。问题在于,如果客户请求为平板电脑定制设计,则该平板电脑设计在 iPad 上以横向模式不可见。

Also if I have a content with sidebar (span9 + span3), if the sidebar is "hidden-tablet", the content will not expand, in fact it will have the same size and I have to overwrite bootstraps span dimmensions to achieve the desired layout.

另外,如果我有一个带有侧边栏(span9 + span3)的内容,如果侧边栏是“隐藏平板电脑”,则内容不会扩展,实际上它的大小相同,我必须覆盖引导程序跨度维度才能实现所需布局。

Am I doing something wrong?

难道我做错了什么?

采纳答案by hajpoj

1) I think the idea here is that in general if someone is requesting a page that is over 980px its more likely that its from a desktop computer than it is from an ipad. Also you could just make your page ipad AND web friendly for those widths :).

1) 我认为这里的想法是,一般来说,如果有人请求一个超过 980 像素的页面,它更有可能来自台式计算机而不是来自 ipad。你也可以让你的页面 ipad 和 web 对这些宽度友好:)。

If you have to have a different design for landscape ipad and the web, an option would be to do write a bunch of custom css for when the screen is between 980 and 1024px.

如果您必须为横向 ipad 和 web 设计不同的设计,那么当屏幕在 980 到 1024 像素之间时,可以选择编写一堆自定义 css。

@media (min-width 980px) and (max-width: 1024px) {
  //my custom css for ipad landscape
}

2) You are doing it right. All .hidden-tabletdoes is set display: none;

2)你做对了。万事.hidden-tablet俱备display: none;

@media (min-width: 768px) and (max-width: 979px) {
  // ... some other code

  .hidden-tablet {
    display: none !important;
  }
}

It does not do any other type of resizing, so thats on you to do with media queries.

它不执行任何其他类型的调整大小,因此您可以使用媒体查询。