Bootstrap 4 define a CSS style for the HTML built-in horizontal divider <hr />
, so just use it.
You can also customize margin with spacing utilities: mt
for margin top, mb
for margin bottom and my
for margin top and bottom. The integer represent spacing 1
for small margin and 5
for huge margin. Here is an example:
<hr class="mt-2 mb-3"/>
<!-- OR -->
<hr class="my-3"/>
<!-- It's like -->
<hr class="mt-3 mb-3"/>
I used to be using just a div
with border-top
like:
<div class="border-top my-3"></div>
but it's a silly method to make the work done, and you can have some issues. So just use <hr />
.