Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing empty divs in grid systems
    primarykey
    data
    text
    <p>I'm using the 1140 grid system and have a basic question: Do you need to use empty divs as "spacers" if you want an element to be less than 12 cols wide? </p> <p>Here's the mockup I'm looking to achieve: </p> <p><img src="https://i.stack.imgur.com/GZujM.png" alt="enter image description here"></p> <p>Basically, I want to footer to be only underneath the primary area, but in its own row. The only way I can see to do this is to use a div as a "spacer" to indent the footer to where I want it. Is this how its done? </p> <p>Here's the code (you'll need to make the preview screen large to see what's going on): <a href="http://jsfiddle.net/saltcod/87DZC/" rel="nofollow noreferrer">http://jsfiddle.net/saltcod/87DZC/</a></p> <pre><code>&lt;link rel="stylesheet" href="https://raw.github.com/robertcedwards/HTML-5-Boilerplate-1140-Grid/master/css/1140.css" type="text/css" media="screen" /&gt; &lt;div id="main"&gt; &lt;h1 class="site-title"&gt;Site Title&lt;/h1&gt; &lt;div class="container"&gt; &lt;div class="row"&gt; &lt;div id="sidebar" class="threecol"&gt; &lt;h4&gt; Sidebar - Three cols&lt;/h4&gt; &lt;ul&gt; &lt;li&gt; Item one&lt;/li&gt; &lt;li&gt; Item two&lt;/li&gt; &lt;li&gt; Item three&lt;/li&gt; &lt;li&gt; Item four&lt;/li&gt; &lt;li&gt; Item five&lt;/li&gt; &lt;/div&gt; &lt;div id="primary" class="ninecol last"&gt; &lt;h3&gt;Nine columns&lt;/h3&gt; &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse vel lectus non nisi pellentesque porta sed vel ante. Aliquam ut elit nulla, ac fermentum diam. Donec convallis dui in felis bibendum mollis. Quisque egestas purus libero, ac vehicula tortor. Sed tristique est sed libero pulvinar nec luctus metus vulputate. Etiam ac tempor nunc. Morbi sit amet neque lacus, ac lacinia nisl. Nullam imperdiet ornare sem, non viverra ipsum hendrerit id. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras vel leo nisl. Ut bibendum ornare urna eget lacinia.&lt;/p&gt; &lt;p&gt;Aliquam ante lectus, ornare a sollicitudin tincidunt, convallis a magna. Sed fermentum lacus id nisl vestibulum interdum. Ut mattis justo in mi vulputate porttitor. Proin sagittis, urna quis blandit semper, velit nisi aliquet dui, et placerat leo purus a erat. Donec congue, elit a eleifend facilisis, lectus sapien placerat augue, in feugiat ante purus sodales libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget lacus sed enim euismod faucibus. Pellentesque facilisis arcu sed leo gravida a ultricies nisi cursus. Quisque venenatis mollis ligula sed semper. Nullam ac sem purus, non tincidunt velit. In hendrerit, odio sit amet tempus pharetra, libero orci suscipit tellus, eu mollis augue dui a nulla. Vivamus dignissim elit sit amet est mollis sed aliquet lorem posuere. Nulla varius purus quis elit pellentesque et auctor nunc gravida. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed nibh erat, aliquet a luctus vel, pulvinar nec neque.&lt;/p&gt; &lt;h2&gt; If I want three blocks inside #primary, that's easy: &lt;/h2&gt; &lt;div class="fourcol bottom"&gt;A&lt;/div&gt; &lt;div class="fourcol bottom"&gt;B&lt;/div&gt; &lt;div class="fourcol bottom last"&gt;C&lt;/div&gt; &lt;/div&gt; &lt;!-- [ .row ] --&gt; &lt;footer class="row twelvecol"&gt; &lt;h3&gt; But if I want three blocks in my footer, I need to 'indent' it with an empty div?&lt;/h3&gt; &lt;div class="threecol empty bottom"&gt; [ empty div ]&lt;/div&gt; &lt;div class="threecol bottom"&gt;A&lt;/div&gt; &lt;div class="threecol bottom"&gt;B&lt;/div&gt; &lt;div class="threecol bottom last"&gt;C&lt;/div&gt; &lt;p&gt; Isn't this a bit like using a spacer gif in a table layout? &lt;/p&gt; &lt;/footer&gt; &lt;/div&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.
    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