<p>Вибери значення <code>order</code> для потрібного блоку:</p>

<hr>

<div class="layout">
  
  <header>
    <h4>Simple website</h4>
  </header>
  
  <main>
      
    <nav id="nav">
      <input type="number" min="0" value="0" class="field" onchange="changeOrder(this.parentElement, this.value);"></input>
    </nav>
      
    <section id="wrapper">
      <input type="number" min="0" value="0" class="field" onchange="changeOrder(this.parentElement, this.value);"></input>
    </section>
      
  </main>
    
  <footer>
    &copy; 2017
  </footer>
    
</div>
* {
  box-sizing: border-box;
  padding: 0;
}

body {
  text-align: center;
  font-family: momospace;
  font-size: 15px;
  line-height: 1.5;
  color: #222;
}

.field {
  padding: 8px 16px;
  font-size: 19px;
}

header {
  line-height: 75px;
  text-align: center;
  text-transform: uppercase;
  background-color: #808080;
  color: #f9f9f9;
}

.box {
  width: 750px;
  border: 4px dashed red;
}

main {
  display: flex;
}

nav,
#wrapper {
  width: 50%;
  padding: 56px 16px;
}

nav {
  background-color: yellow;
}

#wrapper {
  background-color: #eee;
}

footer {
  line-height: 50px;
  background-color: #000;
  color: #f1f1f1;
  margin-top: 16px;
}
function changeOrder(parent, value) {
  parent.style.order = value;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.