Reputation: 119
i'am new with bootstrap , i wanted to have a specific organisation of my view , you can see it in the image , but the problem is i can't manage to have padding between my cols .
<div class="container">
<div class="row">
<div class="col-sm-3" style='border-radius: 5px;border: 2px solid green;'>
<div class="row">
<div class="col-sm-12" style='border-radius: 5px;background-color:red;height:70px;'></div>
<div class="col-sm-12" style='border-radius: 5px;background-color:red;height:140px;'></div>
<div class="col-sm-12" style='border-radius: 5px;background-color:red;height:140px;'></div>
<div class="col-sm-12" style='border-radius: 5px;background-color:red;height:140px;'></div>
</div></div>
<div class="col-sm-9" style='border-radius: 5px;border: 2px solid red;'>
<div class="row">
<div class="col-sm-4 " style='border-radius: 5px;background-color:red;height:220px;'></div>
<div class="col-sm-4" style='border-radius: 5px;background-color:red;height:220px;'></div>
<div class="col-sm-4" style='border-radius: 5px;background-color:red;height:220px;'></div>
</div> </div>
</div>
</div>
and here is what i want to have and what i got with this code.
please help me with that :) thanks
Upvotes: 2
Views: 5302
Reputation: 115
Maybe you could try this one > twitter bootstrap grid system. Spacing between columns, they have managed to answer this question.
also try this one: it renders space without adding extra divs.
<div class="row">
<div class="col-md-6">
<div class="col-md-12">
Some Content..
</div>
</div>
<div class="col-md-6">
<div class="col-md-12">
Some Second Content..
</div>
</div>
</div>
This will automatically render some space between the 2 divs.
Upvotes: 0
Reputation: 566
You this, it will definetly arrange the grid as you required according to the model.
<head>
<style>
.col-sm-12 { margin:3px; width:280px;}
.col-sm-3 { margin: 3px; }
</style>
</head>
<body>
<div class="container">
<div class="outer row">
<div class="col-sm-3" style='border-radius: 5px;border: 2px solid green;'>
<div class="row">
<div class="col-sm-12" style='border-radius: 5px;background-color:red;height:70px;'></div>
<div class="col-sm-12" style='border-radius: 5px;background-color:red;height:140px;'></div>
<div class="col-sm-12" style='border-radius: 5px;background-color:red;height:140px;'></div>
<div class="col-sm-12" style='border-radius: 5px;background-color:red;height:140px;'></div>
</div>
</div>
<div class="col-sm-8" style='border-radius: 5px;border: 2px solid red;'>
<div class="inner row">
<div class="horcols-4 col-sm-3 " style='border-radius: 5px;background-color:red;height:220px;'></div>
<div class="horcols-4 col-sm-3" style='border-radius: 5px;background-color:red;height:220px;'></div>
<div class="horcols-4 col-sm-3" style='border-radius: 5px;background-color:red;height:220px;'></div>
</div>
<div class="col-sm-1" >
</div>
</div>
</div>
</div>
</body>
Upvotes: 1
Reputation: 5177
try this code and see if it suffices
<style>
.inner {
box-sizing: border-box;
padding: 1em;
}
.horcols-4.col-sm-3 {
margin: 1.5em;
}
</style>
</head>
<body>
<div class="container">
<div class="outer row">
<div class="col-sm-3" style='border-radius: 5px;border: 2px solid green;'>
<div class="row">
<div class="col-sm-12" style='border-radius: 5px;background-color:red;height:70px;'></div>
<div class="col-sm-12" style='border-radius: 5px;background-color:red;height:140px;'></div>
<div class="col-sm-12" style='border-radius: 5px;background-color:red;height:140px;'></div>
<div class="col-sm-12" style='border-radius: 5px;background-color:red;height:140px;'></div>
</div>
</div>
<div class="col-sm-9" style='border-radius: 5px;border: 2px solid red;'>
<div class="inner row">
<div class="horcols-4 col-sm-3 " style='border-radius: 5px;background-color:red;height:220px;'></div>
<div class="horcols-4 col-sm-3" style='border-radius: 5px;background-color:red;height:220px;'></div>
<div class="horcols-4 col-sm-3" style='border-radius: 5px;background-color:red;height:220px;'></div>
</div>
</div>
</div>
</div>
</body>
Upvotes: 1