我有一个问题,使引导网格显示正确。我的代码如下
<div class="container">
<div class="row">
<div class="col-md-6">.col-md-6</div>
<div class="col-md-6">.col-md-6</div>
</div>
</div>我看到的只有:grid
有人知道这里发生了什么吗?我已经正确地包含了所有的bootstrap.css、bootstrap-heme.css和bootstrap.js。其他的东西,比如按钮,会被bootstrap正确地格式化。
发布于 2016-08-30 03:51:47
据我所知,你的2个div的格式是应该的吗?(使用引导程序md-6)。
不过,您的div中不需要.col-md-6值:
<div class="container">
<div class="row">
<div class="col-md-6">Your text here</div>
<div class="col-md-6">Your text here</div>
</div>
</div>有关更多信息,请查看Grid Templates上的官方引导程序文档页面
对于文档中使用的网格视图(grid.css),添加以下CSS:
h4 {
margin-top: 25px;
}
.row {
margin-bottom: 20px;
}
.row .row {
margin-top: 10px;
margin-bottom: 0;
}
[class*="col-"] {
padding-top: 15px;
padding-bottom: 15px;
background-color: #eee;
background-color: rgba(86,61,124,.15);
border: 1px solid #ddd;
border: 1px solid rgba(86,61,124,.2);
}
hr {
margin-top: 40px;
margin-bottom: 40px;
}发布于 2016-08-30 04:33:19
按如下方式修改
<div class="container show-grid">
<div class="row">
<div class="col-md-6">.col-md-6</div>
<div class="col-md-6">.col-md-6</div>
</div>
</div>将以下css添加到样式表中
.show-grid div{
border:1px solid ;
}发布于 2016-08-30 04:14:14
Bootstrap创建了一个“不可见”的网格,如果你想这样看它,如果你想让网格可见,你可以用css添加背景色或边框,我最喜欢的是背景色:
css:
.y0 { background-color: #CCC; }
.y1 { background-color: #9FF; }
.y2 { background-color: #F9F; }
.y3 { background-color: #F99; }
.y4 { background-color: #FF6; }
.y5 { background-color: #3C3; }HTML:
<div class="container">
<div class="row">
<div class="col-md-6 y0">Your text here</div>
<div class="col-md-6 y1">Your text here</div>
</div>
</div>https://stackoverflow.com/questions/39214069
复制相似问题