JSFiddle - React, Tailwind, and code Playground
by Gaurav Singh
HTML
<div class="page-wrap">
<div class="content1">
<h1>DIV 1</h1>
</div>
<div class="content2">
<h2>DIV 2</h2>
</div>
</div>
CSS
.page-wrap > div {
width: 100%;
height: 100px;
background-color: lightBlue;
border: 1px solid black;
}
.page-wrap {
display: -webkit-box;
/* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box;
/* OLD - Firefox 19- (doesn't work very well) */
display: -ms-flexbox;
/* TWEENER - IE 10 */
display: -webkit-flex;
/* NEW - Chrome */
display: flex;
/* NEW, Spec - Opera 12.1, Firefox 20+ */
}
.content1 {
-webkit-box-ordinal-group: 1;
/* OLD - iOS 6-, Safari 3.1-6 */
-moz-box-ordinal-group: 1;
/* OLD - Firefox 19- */
-ms-flex-order: 1;
/* TWEENER - IE 10 */
-webkit-order: 1;
/* NEW - Chrome */
order: 1;
/* NEW, Spec - Opera 12.1, Firefox 20+ */
min-width:200px;
width: 50%;
/* No flex here, other cols take up remaining space */
-moz-box-flex: 1;
/* Without this, Firefox 19- expands to widest paragraph, overrides width */
}
.content2 {
-webkit-box-ordinal-group: 2;
/* OLD - iOS 6-, Safari 3.1-6 */
-moz-box-ordinal-group: 2;
/* OLD - Firefox 19- */
-ms-flex-order: 2;
/* TWEENER - IE 10 */
-webkit-order: 2;
/* NEW - Chrome */
order: 2;
/* NEW, Spec - Opera 12.1, Firefox 20+ */
-webkit-box-flex: 2;
/* OLD - iOS 6-, Safari 3.1-6 */
-moz-box-flex: 2;
/* Firefox 19- */
/* For OLD syntax, otherwise collapses. */
min-width:200px;
-ms-flex: 2;
/* TWEENER - IE 10 */
-webkit-flex: 2;
/* NEW - Chrome */
flex: 2;
/* NEW, Spec - Opera 12.1, Firefox 20+ */
background: #ccc;
}
@media screen and (max-width: 500px) {
.page-wrap {
display: block;
}
}