I'm working on adjusting the background to fit within bootstrap's column sizes while still extending across the entire row. Does anyone have suggestions on how to achieve this?
Here is what I've tried:
.yourcontent {
margin-bottom: 5px;
}
.yourcontent [class^=col-] {
background-color: cyan;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="btn-group" role="group" style="margin-top: 5px; margin-bottom: 5px">
<button type="button" class="btn btn-primary">Foo</button>
<button type="button" class="btn btn-primary">Bar</button>
<button type="button" class="btn btn-primary">Foobar</button>
<button type="button" class="btn btn-primary">Barfoo</button>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="row yourcontent">
<div class="col-xs-6">
<div class="">
Foo
</div>
</div>
<div class="col-xs-2">
<div class="">
Bar
</div>
</div>
<div class="col-xs-2">
<div class="">
Foobar
</div>
</div>
<div class="col-xs-2">
<div class="">
Barfoo
</div>
</div>
</div>
</div>
</div>
</div>
I want to achieve a similar look, with the white space between columns also filled with color:
.yourcontent {
margin-bottom: 5px;
background-color: cyan;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="btn-group" role="group" style="margin-top: 5px; margin-bottom: 5px">
<button type="button" class="btn btn-primary">Foo</button>
<button type="button" class="btn btn-primary">Bar</button>
<button type="button" class="btn btn-primary">Foobar</button>
<button type="button" class="btn btn-primary">Barfoo</button>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="row">
<div class="col-xs-6">
<div class="yourcontent">
Foo
</div>
</div>
<div class="col-xs-2">
<div class="yourcontent">
Bar
</div>
</div>
<div class="col-xs-2">
<div class="yourcontent">
Foobar
</div>
</div>
<div class="col-xs-2">
<div class="yourcontent">
Barfoo
</div>
</div>
</div>
</div>
</div>
</div>
I'm looking for a way for the background to extend throughout the whole row without affecting the padding of the first and last col-xs-* elements in the given row. Any suggestions on how to approach this?