.wrapper {
	display: flex;
	/* kich hoat flex box*/
	flex-flow: row wrap;
	font-weight: bold;
	text-align: center;
}

.wrapper>* {
	padding: 10px;
	flex: 1 100%;
	/* cho tất cả phần tử bên trong có độ dài 100% và tỉ lệ chiếm không gian trống là như nhau*/
}

.header-flex-2 {
	background: tomato;
}

.footer-flex-2 {
	background: lightgreen;
	order: 4;
	height: auto;
}

.main {
	text-align: justify;
	background: deepskyblue;
	height: 400px;
	flex: 3 0px;
	/* cho phần nội dung main ở giữa chiếm 3 phần không gian trống so với 2 phần aside bên cạnh */
	order: 2;
}

.aside {
	flex: 1 0 0;
}

/* 2 phần aside sẽ chỉ chiếm 1 phần không gian */
.aside-1 {
	background: gold;
	height: 400px;
	order: 1;
}

.aside-2 {
	background: hotpink;
	height: 400px;
	order: 3;
}

/* Tablet: 601px - 899px - 3 columns layout */
@media screen and (min-width: 601px) and (max-width: 899px) {
	.wrapper>* {
		flex: 1 0 auto;
	}

	.main {
		flex: 2 0 auto;
		order: 2;
	}

	.aside-1 {
		flex: 1 0 auto;
		order: 1;
	}

	.aside-2 {
		flex: 1 0 auto;
		order: 3;
	}

}

/* Laptop: 900px and above - 3 columns layout */
@media screen and (min-width: 900px) {
	.main {
		flex: 3 0;
		order: 2;
	}

	.aside-1 {
		flex: 1 0;
		order: 1;
	}

	.aside-2 {
		flex: 1 0 auto;
		order: 3;
	}

}

@media screen and (max-width: 600px) {
	.wrapper {
		flex-flow: column wrap;
	}

	.wrapper>* {
		flex: 1 100%;
	}

	.main {
		order: 0;
		height: auto;

	}

	.aside-1 {
		order: 2;
		height: auto;
	}

	.aside-2 {
		order: 3;
		height: auto;
	}
}