zsn zsn - 10 days ago 7
HTML Question

Bootstrap Grid layout good practice

I have a question about grid on part of my page, what is better practice to do, in case where I have multiple xx-12 columns in proximity, where my question is not about alignment or breakpoints but of child-parent relations of rows and cols..

<div class="col-xx-12">
<div class="row">
<div class="col-xx-12">something</div>
<div class="col-xx-12">something</div>
<div class="col-xx-12">something</div>
</div>
</div>


or

<div class="col-xx-12">
<div class="row">
<div class="col-xx-12">something</div>
</div>
<div class="row>
<div class="col-xx-12">something</div>
</div>
<div class="row>
<div class="col-xx-12">something</div>
</div>
</div>
</div>

Answer

First is the better option for practice because in this you don't have to repeat your part of code several time like: * starting the class="row".

 <div class="row">
            <div class="col-xx-12">something</div>
            <div class="col-xx-12">something</div>
            <div class="col-xx-12">something</div>
 </div>

Comments