Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Answer based on <a href="https://stackoverflow.com/questions/5445491/height-equal-to-dynamic-width-css-fluid-layout">this post</a></p> <p>You have to make a container for each circle with a 1:1 aspect ratio. thanks to Nathan Ryan who pointed out a css solution for this. He gives a solution for a 4:3 aspect ratio but for your issue, you need a 1:1 aspect ratio. That is why you need to change <code>margin-top:75%;</code> to <code>margin-top:100%;</code> for you container <code>.circle</code></p> <p><strong><a href="http://jsfiddle.net/D6pjd/22/" rel="nofollow noreferrer">Fiddle</a></strong></p> <p>html :</p> <pre><code> &lt;div class="circles"&gt; &lt;div class="circle_container"&gt; &lt;div class="circle"&gt; &lt;span class="circle1"&gt;&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="circle_container"&gt; &lt;div class="circle"&gt; &lt;span class="circle2"&gt;&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="circle_container"&gt; &lt;div class="circle"&gt; &lt;span class="circle3"&gt;&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="circle_container"&gt; &lt;div class="circle"&gt; &lt;span class="circle4"&gt;&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="circle_container"&gt; &lt;div class="circle"&gt; &lt;span class="circle5"&gt;&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="circle_container"&gt; &lt;div class="circle"&gt; &lt;span class="circle6"&gt;&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>CSS :</p> <pre><code>html, body { background: pink; font-family: 'Helvetica Neue' sans-serif; font-size:100%; } .circle_container{ float:left; position: relative; width: 30%; margin:10%; } .circle { margin-top: 100% } .circle1, .circle2,.circle3,.circle4,.circle5,.circle6 { position: absolute; top: 0; bottom: 0; left: 0; right: 0; background: #000; border-radius: 50%; } </code></pre> <p>Setting your container to <code>float:left;</code> instead of <code>display:inline-block</code>will avoid the "white-spaces" between your circles and you will have total control of the width and margins of your circles.</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.
    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