$("main").addClass("clear");
* { margin: 0; padding: 0; } .clear { display: block; clear: both; } .clear:after { content: ""; display: block; clear: both; } html, body header:first-child { margin: 0 auto; } header, main, menu, footer, aside, section, article { display: block; } header, menu, main, footer { width: 80%; margin: .2% auto; -moz-box-shadow: -1px 2px 13px 4px rgba(0, 0, 0, 0.4) inset; -webkit-box-shadow: -1px 2px 13px 4px rgba(0, 0, 0, 0.4) inset; box-shadow: -1px 2px 13px 4px rgba(0, 0, 0, 0.4) inset; border-radius: 4px; } header, footer { min-height: 120px; } main { box-shadow: none; } aside, article, section { float: left; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; border-radius: 4px; -moz-box-shadow: -1px 2px 13px 4px rgba(0, 0, 0, 0.4) inset; -webkit-box-shadow: -1px 2px 13px 4px rgba(0, 0, 0, 0.4) inset; box-shadow: -1px 2px 13px 4px rgba(0, 0, 0, 0.4) inset; } aside { width: 25%; min-height: 150px; } article { width: 44%; min-height: 220px; margin-left: .5%; margin-right: .5%; } section { width: 30%; min-height: 200px; } @media screen and (max-width: 860px) { section { display: none !important; } aside, article { float: left; } aside { width: 30%; min-height: 150px; } article { min-height: 200px; width: 70%; margin: 0; } } @media screen and (max-width: 640px) { body { background: yellow; } main { display: flex; flex-direction: column; justify-content: space-between; /*flex-wrap: wrap;*/ } article { width: 100%; order: 1; } aside { width: 100%; order: 2; } }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <header> header </header> <menu> menu </menu> <main> <aside class=""> aside </aside> <article class=""> article </article> <section> section </section> </main> <footer> footer </footer>