Note that there are some explanatory texts on larger screens.

plurals
  1. POCSS Vertical Float Technique
    primarykey
    data
    text
    <p>Is it possible to have a vertical float working by analogy with the horizontal one? In the Html below I'd like the green button to be as it is and the yellow to float to the bottom beyond gray shape edge.</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;body&gt; &lt;table style="margin: 250px; width:50px; height: 100px; background-color: #ccc; table-layout: fixed;"&gt; &lt;tr&gt; &lt;td style="vertical-align:top;"&gt; &lt;div style="margin-top:-20px; width:50px; height: 40px; background-color: Green;"&gt;Top&lt;/div&gt; &lt;div style="margin-bottom:-20px; width:50px; height: 40px; background-color: Yellow;"&gt;Bottom&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><strong>Update 1</strong> - here's a bit closer to realm picture of what I'm trying to achieve. I'm looking for a vertical uniform panel, i.e. the distance between its children should be the same. I managed to do it with the horizontal layout, but got stuck to the vertical implementation.</p> <p>Html:</p> <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;body&gt; &lt;table style="margin: 250px; width:70px; height: 400px; background-color: #ccc; table-layout: fixed;"&gt; &lt;tr&gt; &lt;td style="vertical-align: middle; background-color: Gray; padding: 5px;"&gt; &lt;!-- &lt;div style="margin-top:-20px; width:50px; height: 40px; background-color: Green;"&gt;1&lt;/div&gt;--&gt; &lt;div style="margin: -20px auto auto auto; width:50px; height: 40px; background-color: white;"&gt;Top!!!&lt;/div&gt; &lt;div style="margin: auto auto -20px auto; width:50px; height: 40px; background-color: white;"&gt;2&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style="vertical-align: middle; background-color: Gray; padding: 5px;"&gt; &lt;div style="margin: auto auto -20px auto; width:50px; height: 40px; background-color: white;"&gt;3&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style="vertical-align: middle; background-color: Gray; padding: 5px;"&gt; &lt;div style="margin: auto auto -20px auto; width:50px; height: 40px; background-color: white;"&gt;4&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style="vertical-align: middle; background-color: Gray; padding: 5px;"&gt; &lt;div style="margin: auto auto -20px auto; width:50px; height: 40px; background-color: white;"&gt;5&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    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.
 

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