I'm creating a page in bootstrap where I'm using 4 cols inside a row. The code:
<div class="row text-center">
<div class="col-md-3"> </div>
<div class="col-md-3"> </div>
<div class="col-md-3"> </div>
<div class="col-md-3"> </div>
</div>
I've added a class to each col so each could have a border.
.cliente {
margin-top:10px;
border: #cdcdcd medium solid;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}
The problem is that the borders should be separated by the natural gutter of the bootstrap grid and that is not working.
Could you help me please? Thanks.
To expand on the
outline
solution, if you want a border that collapses to the same size if two adjacent columns both have borders, usebox-shadow
:The downside to
box-shadow
versusoutline
is thatbox-shadow
may be rendered by any browser at a subpixel position, whereas outlines and borders snap to the nearest pixel. If abox-shadow
ends up on a subpixel position, it will appear soft or blurred. The only way to avoid this is to ensure you don't do things that will cause the column to be aligned on a subpixel position.I did a version which doesn't require extra elements, but might suffer from unequal heights:
How can I add a line between two columns using Twitter Bootstraps grid system
You can use
outline
property. NOcliente
div is needed.You need to use another block element (ie; DIV) inside the columns since Bootstrap 'col-*' uses padding to create the spacing or "gutter" between the grid columns.
Demo: http://www.bootply.com/71ZVOWCFWu