Your layouts will never be the same again
🤑🤑🤑
<header class="page-header"></header>
<article class="main">
<h1>Hello World!</h1>
</article>
<aside class="sidebar">
Ads! 🎉
</aside>
<footer class="page-footer"></footer>
body {
width: 960px;
margin: auto;
}
.main {
float: left;
width: 600px;
}
.sidebar {
float: left;
width: 360px
}
.page-footer {
clear: both;
}
.sidebar {
margin-left: 20px;
width: 340px;
min-height: 400px;
}
.main {
min-height: 400px;
}
Now we need some padding and borders!
.main {
width: 572px; /* 600 - (4+4) - 20 */
border: 4px solid;
padding: 10px;
}
.sidebar {
width: 312px; /* 360 - 20 - (4+4) - 20*/
margin-left: 20px;
border: 4px solid;
padding: 10px;
}
The border is too thick. Let's make it 2px.
We gotta add more padding. 20px.
Hey! The sidebar and the main content still don't match.
F**k 😡
http://brolik.com/blog/wp-content/uploads/2013/05/BRO_ResponsiveDesign_Main2.png
http://jensimmons.com/presentation/designing-grid
<header class="page-header"></header>
<div class="wrapper">
<article class="main">
<h1>Hello World!</h1>
...
</article>
<aside class="sidebar">
Ads! ;)
</aside>
</div>
<footer class="page-footer"></footer>
.wrapper {
display: flex;
}
.main {
flex: 1;
}
.sidebar {
width: 360px;
}