两列布局,中间有一条线。
[ ] | [ ]
[ ] | [ ]
[ ] | [ ]
[ Left Column ] | [ Right Column ]
[ ] | [ ]
[ ] | [ ]
[ ] | [ ]
[ ] | [ ]发布于 2019-01-26 08:19:58
Bootstrap 4现在附带了border utility classes。因此,如果您使用的是Bootstrap 4,则可以在需要它们的列上使用这些类。例如,如果需要列A和列B之间的边框,则需要在列A上添加border-right类。
这是一个演示:
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<div class="container">
<div class="row text-center">
<div class="col border-right">
Column A
</div>
<div class="col">
Column B
<br>
<br>
<br>
Additional content demonstrating that the border stretches to accommodate the height of both columns.
</div>
</div>
</div>
https://stackoverflow.com/questions/11815081
复制相似问题