Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is what you want?</p> <p>I made it with Flexbox, but if you don't wanna use a box model under revision, I could do this with <code>display: table</code>, for example.</p> <p>DEMOs:</p> <ol> <li><a href="http://jsfiddle.net/Jqr2p/1/" rel="nofollow">Layout with Flexbox</a></li> <li><a href="http://jsfiddle.net/Jqr2p/2/" rel="nofollow">Layout with <code>display: table</code></a></li> </ol> <p>**</p> <h2>What I've done?</h2> <p>**</p> <p><strong>First demo: Layout with Flexbox</strong></p> <p>In this demo I only add the follow classes in the <code>body</code> element:</p> <pre><code>&lt;body class="p-flexbox flex-vcc"&gt; &lt;!-- The rest of your content --&gt; &lt;/body&gt; </code></pre> <p>Where:</p> <ol> <li><strong>p-flexbox</strong> means <em>parent-flexbox</em>.</li> <li><strong>flex-vcc</strong> means <em>flexbox-vertical-center-center</em></li> </ol> <p>And the follow CSS rules:</p> <pre><code>.p-flexbox { /* Flexbox: Init setup */ display: -webkit-box; display: -moz-box; display: box; } .flex-vcc { /* Flexbox: Principal setup */ -webkit-box-orient: vertical; -moz-box-orient: vertical; box-orient: vertical; -webkit-box-pack: center; -moz-box-pack: center; box-pack: center; -webkit-box-align: center; -moz-box-align: center; box-align: center; } </code></pre> <p>What means this? It means that all the body's children will center to the vertical axis and will center in the another axis (x axis).</p> <p>Besides, I change a bit your CSS code adding sizes to a few elements.</p> <p><strong>Second demo: Layout with <code>display: table</code></strong></p> <p><code>display: table</code> is a good way to make the layout in a web page. Before, web developers made the layout with <code>table</code> elements (in the markup). This wasn't a good practice because the tables are only for tabular data. But if you use <code>display: table</code> in the style, you will obtain the same result that if you make the layout using <code>table</code> elements in the markup.</p> <p>For do that, you only add the follow classes to the "<em>container</em>" element (in my case, <code>div.principal</code>):</p> <pre><code>div.principal { display: table; } </code></pre> <p>This means that the <code>div.principal</code> will behave like a <code>table</code> element. With this you can add the same properties that a table!</p> <p>For example: <code>border-collapse</code>, <code>border-spacing</code>, etc.</p> <p>Well, that's it.</p> <p>Cheers, Leonardo</p>
    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. VO
      singulars
      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