Note that there are some explanatory texts on larger screens.

plurals
  1. POBootstrap - Best practices on nesting - rows & spans
    primarykey
    data
    text
    <p><strong>What's the best way to use nesting.</strong></p> <p>Multiple spans inside row - <em>dynamic content</em> : </p> <ul> <li>One row per 12 columns ?</li> <li>OR, One row for ANY number of columns ?</li> </ul> <p><strong>Sample case n°1</strong> - which one is the best &amp; why ? : </p> <pre><code>&lt;div class="row"&gt; &lt;span class="span6"&gt;&lt;/span&gt; &lt;span class="span6"&gt;&lt;/span&gt; &lt;span class="span6"&gt;&lt;/span&gt; &lt;span class="span6"&gt;&lt;/span&gt; &lt;/div&gt; </code></pre> <p><strong>Or</strong> </p> <pre><code>&lt;div class="row"&gt; &lt;div class="span6"&gt;&lt;/div&gt; &lt;div class="span6"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class="row"&gt; &lt;div class="span6"&gt;&lt;/div&gt; &lt;div class="span6"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <hr> <p><strong>Sample case n°2</strong> - More levels to organise the content.</p> <p>Here, use the div "my_margin" to add some margin at left &amp; right - and you must have "first_row" around it. </p> <p><strong>So it's :</strong> row-->span10,offset1-->row-->SPANS</p> <pre><code>&lt;div id="first_row" class="row"&gt; &lt;div id="my_margin" class="span10 offset1"&gt; &lt;div class="row"&gt; &lt;div class="span6"&gt;&lt;/div&gt; &lt;div class="span6"&gt;&lt;/div&gt; &lt;div class="span6"&gt;&lt;/div&gt; &lt;div class="span6"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>Or,</strong></p> <p><strong>You shouldn't use the span10,offset1 but direct margin;</strong></p> <p>In that case, you must create rules for each @Media_size to make it responsive.</p> <pre><code>&lt;div style="margin-right:XYpx; margin-left:XYpx" class="row"&gt; &lt;div class="span6"&gt;&lt;/div&gt; &lt;div class="span6"&gt;&lt;/div&gt; &lt;div class="span6"&gt;&lt;/div&gt; &lt;div class="span6"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>Or - Spans are 'supposed' to be use for your main contents, and then you just play with css. So, something like that :</strong></p> <pre><code>&lt;div row&gt; &lt;div class="span6"&gt; http://jsfiddle.net/JkPhw/ &lt;div class="span6"&gt; &lt;div class="span6"&gt; http://jsfiddle.net/JkPhw/ &lt;div class="span6"&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload