Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vertical divider between two columns in bootstrap

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

like image 242
murtaza52 Avatar asked Jan 29 '13 10:01

murtaza52


People also ask

How do I put a vertical line between two divs?

You can use <hr> , as it is semantically correct, and then use CSS to convert it to a vertical line.

How do I split a row into two columns in Bootstrap?

You can use col-md-* class for child element inside the parent row class to split the columns for your need.

How do I add a vertical line between columns in HTML?

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.


2 Answers

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; } 
like image 146
Billy Moat Avatar answered Oct 23 '22 07:10

Billy Moat


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> 
like image 34
pgmank Avatar answered Oct 23 '22 06:10

pgmank