Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to position float items relative to bottom of container DIV?
    primarykey
    data
    text
    <p>I have a DIV (with non-fixed height) and I want some <em>float</em> images, a menu of my site, to be always positioned at fixed distance from the <em>bottom</em> of the DIV.</p> <p>Code is like this:</p> <pre><code>&lt;div class="header" id="header"&gt; &lt;img src="img/aip.png" width="435" height="18" class="pageName"&gt; &lt;!--margin-top: 72px;--&gt; &lt;!--menu. Last item in line is 1st--&gt; &lt;img src="img/m-about.png" width="75" height="10"class="menu" &gt; &lt;img src="img/m-services.png" width="71" height="10" class="menu"&gt; &lt;img src="img/m-portraits.png" width="79" height="10" class="menu"&gt; &lt;img src="img/m-cosplay.png" width="65" height="10" class="menu" &gt; &lt;img src="img/m-concert.png" width="68" height="10" class="menu" &gt; &lt;/div&gt; </code></pre> <p>where class "menu" says <strong>"float:right"</strong> AND contains <strong>margin-top</strong> parameter that sets position of menu from TOP of the "header" DIV. I achieve fixed position related to bottom via adjustments by JS on every resize. This does not work well: since height of enclosing DIV is variable (set in % of screen), I have to call javascript to compute pixel values and make adjustments to margin-top. It causes nasty side effects and jumps. </p> <p>So, instead, I need a pure CSS to set position related to bottom of "header" DIV, not top of it. How can I do it?</p> <p>CSS: </p> <pre><code> .menu { float:right; margin-top:0px; /* adjusted by JS later so menu items have certain margin-top*/ padding:8px; padding-top:10px; padding-bottom:10px; cursor:pointer } .header { display: table-row; background-color:#181818; min-height: 114px; height:10%; } </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