How to make a flex responsive template

Thursday 16th, Mar, 2017 | #HTML 5 #CSS2 / CSS3 #Playground


The flexible box layout is a way of using CSS’s display property in a whole new manner. Block elements stack vertically while inline elements stack horizontally(until they break onto a new line).

Flexbox elements can stack vertically or horizontally based on your setup. They can be evenly spaced across the page or squeezed tight up against each other. The point is offering more control to developers who want to build naturally responsive layouts.



 <div class="content_wrapper">
 <section class="main">


 <aside class="sidebar">

 <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>



/* Header */

 color: #ef5350;
 display: flex;
 justify-content: space-between;

/* Main Section */

.content_wrapper {
 display: flex;

.main {
 text-align: center;
 margin-right: 60px;
 flex: 3;

/* Sidebar */

.sidebar {
 padding: 20px;
 flex: 1;

/* Footer */

footer {
 color: #ef5350;
 text-align: center;
 padding: 20px 0;
 margin-top: 60px;

footer p {
 color: #777;
 font-size: 12px;
 padding: 10px;

@media (max-width: 600px) {
 .content_wrapper {
 flex-direction: column;

 .main {
 margin-right: 0;
 margin-bottom: 60px;