Note that there are some explanatory texts on larger screens.

plurals
  1. PORWD: Center nested DIVs
    primarykey
    data
    text
    <p>Please bear with me - CSS and RWD is quite new to me (a javascript, c++, python person).</p> <p>I'm trying to center a nested DVI on a RWD (responsive web design page) for a friend.</p> <p>The code looks like:</p> <pre><code>&lt;div id="homewrapper" style="margin: 0 auto;"&gt; &lt;div class="section" id="homeleftcol" style="overflow: hidden; margin-left: 7px; margin-right: 7px; text-align: left; clear: left; float: left; cursor: pointer;"&gt; &lt;a title="365x522" href="/a/"&gt;&lt;img style="padding: 0px;" alt="" src="black.png" width="356" height="522" /&gt;&lt;/a&gt; &lt;div class="hometitle" id="imgtitle"&gt;365x522&lt;/div&gt; &lt;/div&gt; &lt;div id="homerightcol" style="clear: none; float: left;"&gt; &lt;div class="section" style="margin-left: 7px; margin-right: 7px; margin-bottom: 0px; overflow: hidden; cursor: pointer;"&gt; &lt;a title="365x254" href="/b/"&gt;&lt;img style="padding: 0px;" alt="" src="yellow.png" /&gt;&lt;/a&gt; &lt;div class="hometitle" id="imgtitle"&gt;365x254&lt;/div&gt; &lt;/div&gt; &lt;div id="learncontact" style="overflow: hidden;"&gt; &lt;div class="section" id="learn" style="margin-left: 7px; margin-right: 7px; overflow: hidden; float: left; cursor: pointer;"&gt; &lt;a title="172x254" href="/c/"&gt;&lt;img style="padding: 0px;" alt="" src="blue.png" width="171" height="254" /&gt;&lt;/a&gt; &lt;div class="hometitle" id="imgtitle"&gt;172x254&lt;/div&gt; &lt;/div&gt; &lt;div class="section" id="contact" style="margin-left: 7px; margin-right: 7px; overflow: hidden; float: left; cursor: pointer;"&gt; &lt;a title="172x254" href="/d/"&gt;&lt;img style="padding: 0px;" alt="" src="red.png" width="171" height="254" /&gt;&lt;/a&gt; &lt;div class="hometitle" id="imgtitle"&gt;172x254&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p></p> <p>Currently I have a mostly ok solution but when the page is enlarged the DIVs hug the left side.</p> <pre><code>Wide: Hugs the margin-left:7px </code></pre> <p><img src="https://i.stack.imgur.com/uPWTB.png" alt="Home - Wide"></p> <p>Here are a few other views (you can see it still hugs to the left but the images scale to fit for the most part.</p> <p><img src="https://i.stack.imgur.com/6InBR.png" alt="Normal"></p> <p><img src="https://i.stack.imgur.com/LLgms.png" alt="Narrow"></p> <p><img src="https://i.stack.imgur.com/bebws.png" alt="VeryNarrow"></p> <p>Your help is <em>greatly</em> appreciated! Thank you so much!!</p>
    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