holy grail flexbox code example
Example 1: holy grail flexbox layout
.holy-grail {
min-height: 100vh;
}
.holy-grail,
.holy-grail-body {
display: flex;
flex: 1 1 auto;
flex-direction: column;
}
.holy-grail-content {
flex: 1 1 auto;
}
.holy-grail-sidebar-1 {
order: -1;
}
@media (min-width: 768px) {
.holy-grail-body {
flex-direction: row;
}
.hg-sidebar {
flex: 0 0 260px;
}
}
Example 2: holy grail flexbox layout
<body class="holy-grail">
<header>
<!-- header content -->
</header>
<div class="holy-grail-body">
<section class="holy-grail-content">
<!-- Main page content -->
</section>
<div class="holy-grail-sidebar-1 hg-sidebar">
<!-- sidebar 1 content -->
</div>
<div class="holy-grail-sidebar-2 hg-sidebar">
<!-- sidebar 2 content -->
</div>
</div>
<footer>
<!-- footer content -->
</footer>
</body>