JSFiddle - React, Tailwind, and code Playground
by Derek Wood
HTML
<body>
<div class="main-wrapper contain">
<section class="main-content">
<h1>Main Content</h1>
<p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.</p>
<p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.</p>
<p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney...
CSS
/* hard reset */
* { -moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
position: relative;
padding: 0; margin: 0;
}
/* micro clear fix (clears floats) */
.contain:before,
.contain:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.contain:after {
clear: both;
}
.contain {
*zoom: 1;
}
/* important structure styles
================================*/
html {
height: 100%; /* 01 */
/* tells html to go ahead and feel free to be 100% height */
}
body {
min-height: 100%; /* 02 */
/* expands to push html to the limit */
}
.main-wrapper {
/* clear fixed instead of overflow:hidden */
}
/* remove any of the 2 items above to see what happens */
.main-content {
width: 100%;
float: left;
}
.other-thing {
width: 100%;
float: left;
}
/* just for presentation
================================*/
html {
background-color: yellow;
}
body {
background: #f06;
padding: .5em;
}
.main-wrapper {
background: rgba(255,255,2552,.5);
padding: 1em;
}
.main-content {
padding: 1em;
background-color: rgba(255,255,255,.5);
}
h1 {
font-size: 2em;
margin-bottom:.5em;
}
p {
margin-bottom: 1em;
}
.other-thing {
padding: 1em;
background-color: rgba(255,255,255,.8);
}
JavaScript
// Make the browser 200px high or so... then scroll down
// If you see yellow that means we have failed.