Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best approach to divide Bootstrap grid columns

I have divided my Bootstrap grid columns following way.

<div class="container-fluid">
    <div class="row">
        <div class="col-md-3">A</div>
        <div class="col-md-6">
            <div class="col-md-12">B1</div>
            <div class="col-md-12">
                <div class="col-md-8">B1.1</div>
                <div class="col-md-4">B1.2</div>
            </div>
            <div class="col-md-12">
                <div class="col-md-10">B2.1</div>
                <div class="col-md-2">B2.2</div>
            </div>
        </div>
        <div class="col-md-3">C</div>
    </div>
</div>

Visual Layout of this code

Please find below of visual layout of this code.

Is my approach of dividing grid columns correct or wrong?

like image 987
CodeMan Avatar asked Dec 15 '15 07:12

CodeMan


Video Answer


1 Answers

Always wrap your column inside a row to avoid any css break when resizing/or something like that

<div class="container-fluid">
    <div class="row">
        <div class="col-md-3">A </div>

        <div class="col-md-6">B
            <div class="row">
                <div class="col-md-12">B1</div>
            </div>
            <div class="row">
                <div class="col-md-8">B1.1</div>
                <div class="col-md-4">B1.2</div>
            </div>
            <div class="row">
                <div class="col-md-10">B2.1</div>
                <div class="col-md-2">B2.2</div>
            </div>
        </div>

        <div class="col-md-3">C </div>
    </div>
</div>
like image 96
Sanjeev Avatar answered Sep 22 '22 09:09

Sanjeev