Flex demo
Fuck codepen
by Darren Galway
HTML
<div class="jumbotron">
<div class="jumbotron-contents">
<h1>This is cool flexbox</h1>
</div>
</div>
<div class="container">
<div class="row">
<div class="item-left">
<p>Kids Wifi</p>
</div>
<div class="item-right">
<p>status</p>
<p>limit</p>
<p>settings</p>
</div>
</div>
</div>
CSS
html,
body {
height: 100%;
}
body {
margin: 0;
padding: 0;
}
.jumbotron {
height: 100%;
display: flex;
background: hotpink;
justify-content: center;
align-items: center;
}
.container {
width: 100%;
margin: 0 auto;
background: #fff
border-top: 1px solid lightgrey;
border-bottom: 1px solid lightgrey;
}
.row {
display: flex;
flex-direction: row;
align-items: center;
height: 250px;
background: orange;
}
@media screen and (max-width: 800px) {
.row {
flex-direction: column;
}
.item-right {
width: 100%;
text-align: center;
justify-content: center;
}
}
.item-left {
color: red;
}
.item-left p {
padding: 1rem;
}
.item-right {
display: flex;
margin-left: auto;
color: green;
}
.item-right p {
padding: 1rem;
}