【发布时间】:2020-01-14 14:41:09
【问题描述】:
我正在创建一个需要有两列的 div,每一列都有对齐的对齐方式。问题是:当我使用两个 div 引导程序 col-lg6- 时看起来不错,但是当涉及到 col-md-6、col-sm-6 时,它会导致单词之间有很多空格,以便在处理不同大小时保持合理的对齐单词。
https://imgur.com/a/Fm4gSMB [图片示例链接]
1) 我已经尝试过使用纯 CSS:
#third-div{
background-color: #904e45;
text-align: justify;
column-count:2;
-webkit-column-gap: 40px;
-moz-column-gap: 40px;
column-gap: 40px;
}
2) 尝试使用word-break: break-all;
但是ofc这会破坏没有语法逻辑的单词。
3) 现在我尝试在引导行中使用两个引导列,例如:
<div id="third-div" class="page-div">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6">
<h1>Lots of text</h1>
<h2 class="fio">But divided: two columns</h2>
<p> a lot of text here </p>
</div>
<div class="col-lg-6 col-md-6 col-sm-6">
<p> a lot of text here </p>
</div>
</div>
</div>
.page-div{
padding: 15%;
padding-left: 15%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
#third-div{
background-color: #904e45;
text-align: justify;
}
【问题讨论】:
标签: html css bootstrap-4 frontend multiple-columns