This is what I want to do :
And this is what I have :
And this is my code :
Html
<div class="row">
<div class="col-md-4">col-md-4</div>
<div class="col-md-6">col-md-6 ...</div>
<div class="col-md-2">col-md-2</div>
</div>
Css
.col-md-4,.col-md-2 {
background-color: #e3e3e3;
}
.col-md-6 {
background-color: #f5f3f3;
}
I checked other questions on the subject but I'm not satisfied with the answers... can someone help me to improve my code ? thank you !
We can add background color to a div by simply adding class “bg-primary”, “bg-success”, “bg-danger”, “bg-info”, and many more as shown in the following examples.
Using pre-defined classes, we can change the color of table cells and table rows. In order to change the color of the table row, we need to specify in <tr> tag with the required class & for changing the color of the table row then specify it inside <td> tag with the required class.
Creating a transparent navbar is very easy - just don't add a color class . bg-* to the navbar. In this case, the Navbar will take the color of the parent's background color.
Look here in JSFiddle...
I hope you are looking for this output. If yes then try the following code:
HTML:
<div class="row">
<div class="col-md-4 row-height">
<span>col-md-4</span>
</div>
<div class="col-md-6 row-height">
col-md-6
</div>
<div class="col-md-2 row-height">
col-md-2
</div>
</div>
And CSS:
.row {
padding: 100px;
}
.row-height {
height: 70px;
text-align: center;
padding-top: 25px;
}
.col-md-4,.col-md-2 {
background-color: #e3e3e3;
}
.col-md-6 {
background-color: #f5f3f3;
}
.col-md-4 {
border-radius: 15px 0 0 15px;
}
.col-md-2 {
border-radius: 0 15px 15px 0;
}
You can modify the CSS the way you want and sizes in the styles according to the content.
Hope this helps...
You could color the entire .row
and then the middle column separately..
.row {
background-color: #e3e3e3;
border-radius: 15px;
}
.col-md-6 {
background-color: #f5f3f3;
}
http://codeply.com/go/FXSkrecwwI
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