Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to center a section containing unordered lists
    primarykey
    data
    text
    <p>I'm trying to center the section (<code>.provincia</code>) with which contains unordered lists.</p> <p>I have tried a standard <code>margin: 0 auto</code> but it is not working as I expected.</p> <p>How can I fix this?</p> <p>Here is my Fiddle demo: <a href="http://jsfiddle.net/F6hrC/" rel="nofollow">http://jsfiddle.net/F6hrC/</a></p> <p><strong>CSS</strong> </p> <pre><code>.poblaciones-container { width: 1400px; border: 1px solid black; } .poblaciones { margin: 0 auto; } .provincia { float: left; margin-left: 20px; width: 300px; } </code></pre> <p><strong>HTML</strong> </p> <pre><code>&lt;section class="poblaciones-container"&gt; &lt;section class="poblaciones fila2"&gt; &lt;div class="provincia"&gt; &lt;ul&gt; &lt;h2&gt;Soria&lt;/h2&gt; &lt;li&gt;Cuellar&lt;/li&gt;&lt;li&gt;El Espinar&lt;/li&gt; &lt;li&gt;Real Sitio de San Ildefonso&lt;/li&gt;&lt;li&gt;Palazuelos de Eresma&lt;/li&gt; &lt;li&gt;Cantalejo&lt;/li&gt;&lt;li&gt;La Lastrilla&lt;/li&gt; &lt;li&gt;Nava de la Asunción&lt;/li&gt;&lt;li&gt;San Cristobal de Segovia&lt;/li&gt; &lt;li&gt;Carbonero del Mayor&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="provincia"&gt; &lt;ul&gt; &lt;h2&gt;Segovia&lt;/h2&gt; &lt;li&gt;Almazán&lt;/li&gt;&lt;li&gt;Burgo de Osma&lt;/li&gt; &lt;li&gt;Ólvega&lt;/li&gt;&lt;li&gt;San Esteban de Gormaz&lt;/li&gt; &lt;li&gt;Ágreda&lt;/li&gt;&lt;li&gt;San Leonardo de Yague&lt;/li&gt; &lt;li&gt;Golmayo&lt;/li&gt;&lt;li&gt;Covaleda&lt;/li&gt; &lt;li&gt;Arcos de Jalón&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="provincia"&gt; &lt;ul&gt; &lt;h2&gt;Ávila&lt;/h2&gt; &lt;li&gt;Arévalo&lt;/li&gt;&lt;li&gt;Arenas de San Pedro&lt;/li&gt; &lt;li&gt;Las Navas del Marqués&lt;/li&gt;&lt;li&gt;Candeleda&lt;/li&gt; &lt;li&gt;Sotillo de la Adrada&lt;/li&gt;&lt;li&gt;El Tiemblo&lt;/li&gt; &lt;li&gt;Cebreros&lt;/li&gt;&lt;li&gt;La Adrada&lt;/li&gt; &lt;li&gt;El Barco de Ávila&lt;/li&gt;&lt;li&gt;El Hoyo de Pinares&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/section&gt; &lt;/section&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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