Answer the question
In order to leave comments, you need to log in
Row to col or vice versa?
Sometimes it works differently and confuses a little. What is the correct way to arrange the sequence of elements? Let's say the site header: header>container>row>col-md-12 or what?
And do I need to re-specify container>row in each section, for example:
header>top-line>container>row>col-md-12
header>bottom-line>container>row>col-md-12 ?
I understand that it is possible to read the documentation but nevertheless I do not understand a little.
Answer the question
In order to leave comments, you need to log in
Actually it's right
<header>
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="top-line">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="bottom-line">
</div>
</div>
</div>
</div>
</header>
<header>
<table>
<tr>
<td>
<div class="top-line">
</div>
</td>
</tr>
<tr>
<td>
<div class="bottom-line">
</div>
</td>
</tr>
</table>
</header>
<header>
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="top-line">
<div class="row">
<div class="col-md-6"></div>
<div class="col-md-6"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="bottom-line">
<div class="top-line">
<div class="row">
<div class="col-md-6"></div>
<div class="col-md-6"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
The answer lies in the details. Each col has 15px padding on each side. row has -15px margins on each side.
As a result, this design is intended
On the example of your design:
<div class="header">
<div class="top-line">
<div class="container"> <!-- Дает padding 15px слева/справа -->
<div class="row"> <!-- Убирает отступы предыдущего класса -->
<div class="col-md-12"> <!-- Дает padding 15px слева/справа -->
<p>Какой-то контент</p>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6"></div>
<div class="col-md-6"></div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question