Note that there are some explanatory texts on larger screens.

plurals
  1. POCss alternative to js solution, html in wrong order to use float
    primarykey
    data
    text
    <p>My framework is spitting out html in the wrong order for my layout. I could change it but for other media the order is correct. Currently I have a simple line of javascript to transport the html but I was wondering if there was a css alterative.</p> <p>Here is the simplefied exaple. The first example is how it should work, the second is what I have now. I'd like to know if the same layout can be accomplished on the second example, the desired version wihtout using the javascript</p> <p><a href="http://jsfiddle.net/SPgyA/1/" rel="nofollow">http://jsfiddle.net/SPgyA/1/</a></p> <pre><code>&lt;div id="wrap"&gt; &lt;div id="right" class="somediv"&gt; div right, dont know height in advance &lt;/div&gt; &lt;div id="main"&gt; main text, dont know height in advance&lt;br /&gt; main text, dont know height in advance&lt;br /&gt; main text, dont know height in advance&lt;br /&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="desired_wrap"&gt; &lt;div id="desired_main"&gt; main text, dont know height in advance&lt;br /&gt; main text, dont know height in advance&lt;br /&gt; main text, dont know height in advance&lt;br /&gt; &lt;/div&gt; &lt;div id="desired_right" class="somediv"&gt; div right, dont know height in advance &lt;/div&gt; &lt;/div&gt; </code></pre> <p>​</p> <p>the javascript:</p> <pre><code>$("#desired_right").prependTo("#desired_wrap"); </code></pre> <p>the css</p> <pre><code>#wrap,#desired_wrap{ width:200px; margin:10px; padding:10px; border:1px dashed grey; } #right{ float:right; } #desired_right{ float:right; } .somediv{ color:red; width:100px; background-color:#eee; } </code></pre> <p>​</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.
 

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