Boostrap集装箱净化和边界
我正在学习Bootstrap。以下是要在不同容器中显示按钮的代码:
<div class="container" style="border:1px solid #cecece;">
<h1>Bootstrap 4 simple container (.container class)</h1>
<p>
<button type="button" class="btn btn-info">example button 1</button>
<button type="button" class="btn btn-danger">example button 2</button>
</p>
</div>
<div class="container-fluid" style="border:1px solid #cecece;">
<h1>Bootstrap 4 fluid container (.container-fluid class)</h1>
<p>
<button type="button" class="btn btn-info">example button 1</button>
<button type="button" class="btn btn-danger">example button 2</button>
</p>
<div class="container-md" style="border:1px solid #cecece;">
<h1>Bootstrap 4 container-md (.container-md class)</h1>
<p>
<button type="button" class="btn btn-info">example button 1</button>
<button type="button" class="btn btn-danger">example button 2</button>
</p>
</div>
结果是:
问题:
没有指定的对齐方式,但是3种类型的容器对齐(容器和容器 - MD与中心对齐,而容器 - 弗利德在左侧对齐)。是否有不同类型的容器的默认对齐?
为什么容器 - 弗利德缺少底部边框?
I'm learning bootstrap. Following is the code to display buttons in different containers:
<div class="container" style="border:1px solid #cecece;">
<h1>Bootstrap 4 simple container (.container class)</h1>
<p>
<button type="button" class="btn btn-info">example button 1</button>
<button type="button" class="btn btn-danger">example button 2</button>
</p>
</div>
<div class="container-fluid" style="border:1px solid #cecece;">
<h1>Bootstrap 4 fluid container (.container-fluid class)</h1>
<p>
<button type="button" class="btn btn-info">example button 1</button>
<button type="button" class="btn btn-danger">example button 2</button>
</p>
<div class="container-md" style="border:1px solid #cecece;">
<h1>Bootstrap 4 container-md (.container-md class)</h1>
<p>
<button type="button" class="btn btn-info">example button 1</button>
<button type="button" class="btn btn-danger">example button 2</button>
</p>
</div>
The result is:
Question:
There are no alignments specified in the code, but the 3 types of container align differently (container and container-md align to the center, while container-fliud aligns to the left). are there default alignment for different type of containers?
Why is the bottom border missing for container-fliud?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的第二个容器没有DIV关闭标签。下面的代码应修复它。
You don't have a div closing tag for your second container. The code below should fix it.
请参阅此片段,
container-fluid
divrefer this snippet
container-fluid
div