问题描述
我只是Bootstrap 4的初学者.
I'm just a beginner in Bootstrap 4.
我刚刚开始学习它,可悲的是,我已经遇到了问题.我从Bootstrap 4手册本身修改了一些代码.但是,它失败了,偏移量无法正常工作.该代码非常简单,尽管不需要很多代码.
I just started learning it recently and sadly, I have been encountering problems already. I modified some code from the Bootstrap 4 manual itself. However, it fails miserably, with the offset not working properly. The code is perfectly simple and doesn't require a lot of code though.
这是我使用的代码:
<!-- This contains the .red, .blue and .green classes -->
<style> ... </style>
<div class="container">
<div class="row">
<div class="col-md-4 red">
Hello world
</div>
<div class="col-md-4 col-offset-md-4 green">
Hello world
</div>
<div class="col-md-4 col-offset-md-4 blue">
Hello world
</div>
</div>
因此,我怀疑引导程序中确实存在一个名为"col-md-offset- *"的类,因为该类无法正常工作.因此,在Safari中,我打开了开发">显示Web检查器",并查看了通过CDN链接的Bootstrap文件.我搜索了类col-md-offset-4
,它没有出现.但是,我看到了md-offset-4
.我还看到,发现的不是类col-md-push-4
,而是所有的md-push-4
,依此类推.因此,我改用md-push-4
,它的效果与Bootstrap中的示例一样好.
So, I doubted that there is in fact a class in bootstrap called "col-md-offset-*" as it fails to work. So, in Safari, I opened Develop > Show Web Inspector and took a look at the Bootstrap file that is linked via CDN. I searched for the class col-md-offset-4
, and it didn't appear. However, I saw md-offset-4
instead. I also saw that instead of the class col-md-push-4
, all I found is md-push-4
and so on and so forth. Therefore, I instead used the md-push-4
and it worked as good as the example in Bootstrap.
这解决了用户Nate Conley的回答.顺便说一句,这取自 http://v4-alpha.getbootstrap.com/layout/grid/.在撰写本文时,Bootstrap团队的任何变更都是不可预见的或未知的.
This addresses answer by user Nate Conley. By the way, this was taken from http://v4-alpha.getbootstrap.com/layout/grid/ as of the time this question was edited. Any change of the Bootstrap team is unforeseen or unknown at this time of writing.
<style> ... </style>
<div class="container">
<div class="row">
<div class="col-md-4 red">
Hello world
</div>
<div class="col-md-4 offset-md-4 green">
Hello world
</div>
<div class="col-md-4 offset-md-4 blue">
Hello world
</div>
</div>
推荐答案
使用Boootrap 3.3.6 版本,col-md-offset- *可以正常工作.但是,正是Bootrap 4 出现了故障.
我在vp_arth用户的建议在此发布的问题上看到,在Github中的 Bootstrap 4开发存储库中. 到目前为止,网格系统的Bootsrap v4文档尚未应用来自github的经过编辑的文档,可以通过以下链接进行访问:
Using Boootrap 3.3.6 release, col-md-offset-* is working. However, it is in Bootrap 4 that has failure.
As seen on an issue I posted, as recommend by user vp_arth here, in the Bootstrap 4 Development Repository in Github. The Bootsrap v4 documentation of the grid system, as of the moment has not yet applied the edited one from github, which can be accessed through these links:
b)使用示例网格系统
这篇关于Bootstrap 4接受offset-md- *,而不是col-offset-md- *命名约定Bug的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!