gpt4 book ai didi

css - 缺少 CSS Div 之间的间隙

转载 作者:行者123 更新时间:2023-11-28 16:05:51 25 4
gpt4 key购买 nike

我遇到了一个小问题,过去一个小时我一直无法解决,我想要 div 之间的垂直间隙,但我不确定为什么没有显示,下面是两张图片,第一张是代码当前显示的内容,第二个是显示缺失间隙的 Photoshop 图片,如果有人可以提供帮助,我将不胜感激,非常感谢

<div class="container">
<div class="row" style="background-color:#a8b2c1;">
<div class="col-md-6">
<div class="col-md-12" style="background-color:#6d90c4;">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
<div class="col-md-12" style="background-color:#6d90c4;">
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
</div>
</div>
<div class="col-md-6">
<div class="col-md-12" style="background-color:#4d6487;">
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
</div>
</div>
</div>
</div>

Gap missing

Example shown with gap

最佳答案

这就是 Bootstrap 的工作原理。列之间没有垂直间距。您可以使用自定义类简单地添加 margin-bottom

.mb {
margin-bottom:15px;
}

然后像这样使用类...

<div class="col-md-12 mb"></div>

此外,确保嵌套/内部列始终包含在另一个行中。

http://www.codeply.com/go/16c6c71iAq

Bootstrap 4.x 中,spacing utilities will be included

关于css - 缺少 CSS Div 之间的间隙,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43659998/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com