Following design is made in photoshop
with a 12 grid system
:
I’m trying to create this using bootstrap
with class='col-md-3'
for each input
however, when I do this they display next to each other but when I add a margin
only 3 divs
display per row. Am I doing something wrong? I thought bootstrap automatically added margins for col’s.
<div class="songs col-md-3"><input type="checkbox" name="chk_spirit" value="Bleeding Love">Bleeding Love</div>
<div class="songs col-md-3"><input type="checkbox" name="chk_spirit" value="Better in Time">Better in Time</div>
<div class="songs col-md-3"><input type="checkbox" name="chk_spirit" value="Angel">Angel</div>
<div class="songs col-md-3"><input type="checkbox" name="chk_spirit" value="I Will Be">I Will Be</div>
2
Answers
Bootstrap has a class ‘row’ that you can use to define rows. When your columns are wrapped in a row, some margin is applied.
CSS from Bootstrap:
Wrappe your divs like this:
Depending on how much margin you are applying, the columns may not all fit within your row. It may also be helpful for you to reed up on containers and how they behave.
I would have commented but I don’t have enough reputation yet.
You could use Inline checkboxes and radios and add another class inside your columns for any styling.