<div class="island">
  <p>With Flexbox</p>
  <p><small>simple grid with floats (horizontal layout breakpoint at 640px)</small></p>
  <button type="button" onclick="toggleFlexbox();" id="toggle">Toggle Flexbox</button>
</div>

<div class="island">
  <div class="row row--flex row--flex-flip">
    <div class="col">
      <article class="article">
        <p>Source order: 1</p>
      </article>
    </div>
    <div class="col">
      <article class="article">
        <p>Source order: 2</p>
      </article>
    </div>
    <div class="col">
      <article class="article">
        <p>Source order: 3</p>
      </article>
    </div>
  </div>
</div>

<div class="island">
  <p>Alternate Method</p>
  <p>
    <small>horizontal layout uses negative margins to reverse order </small>
    <br>
    <small>vertical layout uses display table footer / header group</small>
  </p>
</div>

<div class="island">
  <div class="row row--reverse">
    <div class="col">
      <article class="article">
        <p>Source order: 1</p>
      </article>
    </div>
    <div class="col">
      <article class="article">
        <p>Source order: 2</p>
      </article>
    </div>
    <div class="col">
      <article class="article">
        <p>Source order: 3</p>
      </article>
    </div>
  </div>
</div>

<div class="island">
  <p>
    <small>table display is limited for vertical layout, you can only define the first (<code>table-header-group</code>) and last (<code>table-footer-group</code>) cells</small>
  </p>
  <br>
  <p>See my blog article: <a target="_blank" href="http://dbushell.com/2015/06/01/order-html-vs-css/">Order: HTML vs CSS</a></p>
</div>

$gutter: 20px;

* {
  box-sizing: border-box;
}

.island {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 $gutter;
}

.row {
  overflow: hidden;
  margin: 0 (-$gutter/2);
}

.col {
  float: left;
  width: 100%;
  padding: 0 $gutter/2;
  margin-bottom: 20px;
}

.flexbox .row--flex {
  display: flex;
  flex-wrap: nowrap;
  flex-direction: column;
}

.flexbox .row--flex-flip {
  
  .col:nth-child(1) {
    order: 3;
  }
  
  .col:nth-child(2) {
    order: 1;
  }
  
  .col:nth-child(3) {
    order: 2;
  }
}

@media screen and (min-width: 640px)
{
  .flexbox .row--flex {
    display: flex;
    flex-direction: row;
  }
  
  .col {
    width: 33.333%;
  }
  
  .row--reverse {
    
    .col {
      margin-right: -100%;
    }
    
    .col:nth-child(1) {
      margin-left: 66.666%;
    }
    
    .col:nth-child(3) {
      margin-left: 33.333%;
    }
  }
}

@media screen and (max-width: 639px)
{
  .row--reverse {
    display: table;
    width: 100%;
    margin: 0;
  
    .col {
      float: none;
      padding: 0;
      margin: 0;
      
      &:after {
        display: block;
        content: "";
        height: 20px;
      }

      &:nth-child(1) {
        display: table-footer-group;
      }

      &:nth-child(2) {
        display: table-header-group;
      }
    }
  }
}

/* visual demo */

h1 {
  font-size: 20px;
  margin: 30px 0;
}

p {
  font-size: 16px;
  font-weight: bold;
  margin: 0 0 15px 0;
  
  &:last-child {
    margin-bottom: 0;
  }
}

small {
  font-weight: normal;
}

.island {
  padding: 0 20px;
  margin: 20px auto;
}

.article {
  text-align: center;
  color: #fff;
  padding: 20px;
}

.col {
  
  &:nth-child(1) .article {
    background: #f39c12;
  }
  
  &:nth-child(2) .article {
    background: #3498db;
  }
  
  &:nth-child(3) .article {
    background: #2c3e50;
  }
}

#toggle {
  padding: 5px 10px;
  font-size: 12px;
  line-height: 20px;
  font-weight: bold;
  text-transform: uppercase;
  
  &:after {
    content: " " attr(data-label);
    font-size: 17px;
    text-transform: none;
  }
  
  &[data-label="☑"] {
    color: #27ae60;
  }
  
  &[data-label="☐"] {
    color: #c0392b;
  }
}
View Compiled

function toggleFlexbox() {
  $(document.documentElement).toggleClass('flexbox no-flexbox');
  Modernizr.flexbox = !Modernizr.flexbox;
  updateButton();
}

function updateButton() {
  $('#toggle').attr('data-label', Modernizr.flexbox ? '☑' : '☐');
}

if (!Modernizr.flexbox) {
  document.getElementById('toggle').disabled = 'disabled';
  document.getElementById('toggle').innerHTML = 'Flexbox unsupported';
} else {
  updateButton();
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. //cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js
  2. //ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js