Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I make floated elements resize correctly
    primarykey
    data
    text
    <p>I have been trying to figure this out for a while and everything I try fails to produce the result I am after.</p> <p>So the setup is as follows</p> <h2>HTML</h2> <pre><code>&lt;div class="container"&gt; &lt;div class="icon-holder"&gt; &lt;img src="https://cdn3.iconfinder.com/data/icons/free-social-icons/67/facebook_square-128.png" class="icon"/&gt; &lt;/div&gt; &lt;div class="icon-holder"&gt; &lt;img src="https://cdn3.iconfinder.com/data/icons/free-social-icons/67/facebook_square-128.png" class="icon"/&gt; &lt;/div&gt; &lt;div class="icon-holder"&gt; &lt;img src="https://cdn3.iconfinder.com/data/icons/free-social-icons/67/facebook_square-128.png" class="icon"/&gt; &lt;/div&gt; &lt;div class="icon-holder"&gt; &lt;img src="https://cdn3.iconfinder.com/data/icons/free-social-icons/67/facebook_square-128.png" class="icon"/&gt; &lt;/div&gt; &lt;div class="icon-holder"&gt; &lt;img src="https://cdn3.iconfinder.com/data/icons/free-social-icons/67/facebook_square-128.png" class="icon"/&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <h2>CSS</h2> <pre><code>.icon-holder { float:left; height:100%; width:auto; } .container { height:100px; } .icon { height:auto; width: auto; max-height: 100%; display:block; } .container-before { height:100px; } .container-after { height:20px; } </code></pre> <p>Now the problem lies in that if I use javascript to resize the container I need the images to resize with it and have no spacing in between. I need a CSS solution that works, I know I can hack it with JS but thats not what I am trying to accomplish.</p> <p>I have an example running at <a href="http://jsfiddle.net/twmxh/3/" rel="nofollow">http://jsfiddle.net/twmxh/3/</a> of the whole issue with expected output.</p> <h2>UPDATE</h2> <p>Just a bit more about the implementation. The <code>container</code> div is actually a toolbar with a resize handle. So the container is the only element I can apply the new height on. </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