Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If both the height of the image and the text are variable, it's not particularly easy with pure CSS.</p> <p>The height being variable rules out anything based on <code>position: absolute</code>, as in the answers you received to <a href="https://stackoverflow.com/questions/10412896/move-the-first-div-appear-under-the-second-one-in-css">your previous similar question</a>.</p> <p>One option is to use the technique shown here: <a href="http://tanalin.com/en/articles/css-block-order/" rel="nofollow noreferrer">http://tanalin.com/en/articles/css-block-order/</a></p> <blockquote> <p>It is possible to change vertical order of blocks on HTML page using CSS table presentation using properties of display: table family. Regardles of block order in HTML code, header (<code>table-header-group</code>) of such table is displayed at the top of it, footer (<code>display: table-footer-group</code>)—at the bottom, and table body (<code>table-row-group</code>)—between header and footer.</p> </blockquote> <p>This works in all modern browsers, and IE8 if you're careful. It <em>does not</em> work in IE6/7.</p> <p>Here's your code using this technique: <a href="http://jsfiddle.net/thirtydot/7hCNC/35/" rel="nofollow noreferrer">http://jsfiddle.net/thirtydot/7hCNC/35/</a></p> <p>I have to admit that I've never used this technique on a production website, so please test thoroughly.</p> <p>A different approach that will work in <a href="http://caniuse.com/transforms2d" rel="nofollow noreferrer">all browsers that support CSS3 2D transforms</a> is to vertically flip the whole container, and then do the same to the "image" and the "text" elements. In browsers that do not support CSS3 transforms, everything will still work, but the "image" and "text" elements will be in their original order. In other words, it degrades nicely. It's probably possible to make this work in IE6-8 using <code>filter</code>, but that would make the text look horrible, so forget about it.</p> <p>Here's your code using this technique: <a href="http://jsfiddle.net/thirtydot/7hCNC/36/" rel="nofollow noreferrer">http://jsfiddle.net/thirtydot/7hCNC/36/</a></p> <p>If none of these CSS methods are good enough, you'll have to use JavaScript.</p> <p>However, I personally recommend that you just <a href="http://jsfiddle.net/thirtydot/7hCNC/37/" rel="nofollow noreferrer">switch the order in the HTML</a>. I doubt Google cares <a href="https://stackoverflow.com/questions/10412896/move-the-first-div-appear-under-the-second-one-in-css#comment13434314_10412896">about it</a>. In this case, I really doubt that bending over backwards to keep your HTML in the "optimum order" will have any meaningful SEO impact.</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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