twitter-bootstrap Bootstrap 3 网格布局在 IE8 中不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18766579/
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 18:22:28  来源:igfitidea点击:

bootstrap 3 grid layout not working in IE8

twitter-bootstrapinternet-explorer-8

提问by anirvan

I've been trying to get the grid layout system of Bootstrap 3 to work well with IE8, but it just doesn't work. I do not have any need for a responsive layout.

我一直在尝试让 Bootstrap 3 的网格布局系统与 IE8 配合使用,但它只是不起作用。我不需要响应式布局。

To be absolutely sure that I'm not introducing some random errors in the HTML file I've created, I went ahead and downloaded a fresh copy of Bootstrap 3. After extracting the contents, I opened the example grid HTML file (within the /examples/grid folder), and lo behold, even in the official distribution, the grids appear stacked on top of each other, instead of spanning across a row!

为了绝对确定我没有在我创建的 HTML 文件中引入一些随机错误,我继续下载了 Bootstrap 3 的新副本。提取内容后,我打开了示例网格 HTML 文件(在 / examples/grid 文件夹),你瞧,即使在官方发行版中,网格也出现在彼此的顶部,而不是跨越一行!

What's strange though, when I browse to the inline formssection of the online documentation on my IE8, the grid layout seems to work just fine.

奇怪的是,当我在 IE8 上浏览到在线文档的内联表单部分时,网格布局似乎工作得很好。

回答by Loran

According to the Bootstrap 3 docsyou need to include Respond.jsin order to get the CSS 3 media queries to work. Hope that helps!

根据Bootstrap 3 文档,您需要包含Respond.js才能使 CSS 3 媒体查询工作。希望有帮助!

回答by anirvan

The problem it appears is using the wrong class for the grids. Even though the screen size of my Windows system was larger than my Mac book's, I made the wrong assumption that the resolution would be the same or higher.

它出现的问题是为网格使用了错误的类。即使我的 Windows 系统的屏幕尺寸比我的 Mac book 的大,我也错误地假设分辨率将相同或更高。

I had developed my site on the mac, and used .col-md-classes for the grid layout. However, since the resolution of my Win device was lower, .col-xs-should have been used. And hence, it was appearing stacked.

我在 mac 上开发了我的网站,并使用.col-md-了网格布局的类。但是,由于我的 Win 设备的分辨率较低,.col-xs-应该可以使用。因此,它看起来是堆叠的。

Lesson: Even though your Win system might have a larger screen, it's resolution can be as low as that of a tablet.

教训:即使您的 Win 系统可能有更大的屏幕,它的分辨率也可能与平板电脑一样低。