JSFiddle - React, Tailwind, and code Playground
by LuckyCat
HTML
<div class="wrapper">
<div class="main-container">
<div class="header">
Header
</div>
<div class="desktop">
<div yellow>Photos</div>
<div orange>Text</div>
<div purple>Form</div>
</div>
</div>
</div>
CSS
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/*html,
body,
.desktop {
height: 100%;
}*/
html, body, .wrapper {
min-height: 100%;
height: 100%;
}
.main-container {
min-height: 100%;
display: flex;
flex-direction: column;
}
.header {
background: green;
width: 100%;
}
/*main,
div {
display: flex;
padding: 1rem;
}*/
.desktop {
display: flex;
padding: 1rem;
flex-direction: column;
flex-wrap: wrap;
/*height: 400px;*/
width: 100%;
flex-grow: 1;
align-items: stretch;
}
/*div {
display: flex;
padding: 1rem;
flex: 1;
width: 30%;
}*/
[orange] {
display: flex;
padding: 1rem;
flex: 1;
width: 30%;
background-color: #FFAD77;
flex: 0 0 70%;
}
[yellow] {
display: flex;
padding: 1rem;
flex: 1;
width: 30%;
background-color: #FFE377;
flex: 0 0 100%;
width: 70%;
}
[purple] {
display: flex;
padding: 1rem;
flex: 1;
width: 30%;
background-color: #FF77C8;
}
@media(max-width: 480px) {
.desktop div {
flex: 1;
width: 100%;
}
div[orange] {
order: -1;
flex: 2;
}
div[yellow] {
flex: 5;
}
div[purple] {
flex: 1;
}
}