I am using twitter bootstrap, and have a row which has two columns (span6). How do I create a vertical divider between both the spans.
Thanks, Murtaza
You can use <hr> , as it is semantically correct, and then use CSS to convert it to a vertical line.
You can use col-md-* class for child element inside the parent row class to split the columns for your need.
To make a vertical line, use border-left or border-right property. The height property is used to set the height of border (vertical line) element. Position property is used to set the position of vertical line. Example 1: It creates a vertical line using border-left, height and position property.
If your code looks like this:
<div class="row"> <div class="span6"> </div> <div class="span6"> </div> </div>
Then I'd assume you're using additional DIVS within the "span6" DIVS for holding/styling your content? So...
<div class="row"> <div class="span6"> <div class="mycontent-left"> </div> </div> <div class="span6"> <div class="mycontent-right"> </div> </div> </div>
So you could simply add some CSS to the "mycontent-left" class to create your divider.
.mycontent-left { border-right: 1px dashed #333; }
In Bootstrap 4 there is the utility class border-right
which you can use.
So for example you can do:
<div class="row"> <div class="col-6 border-right"></div> <div class="col-6"></div> </div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With