JSFiddle - React, Tailwind, and code Playground

by jordenvanforeest

HTML

<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <title>Free Grid in HTML5 and CSS3</title>

<style>
</style>

</head>
<body>

<section class="row">
<div>
<article>
<p>col 1 of 1</p>
</article>
</div>
</section>

<section class="row">
<div>
<article>
<p>col 1 of 2</p>
</article>
</div>
<div>
<article>
<p>col 2 of 2</p>
</article>
</div>
</section>

<section class="row">
<div>
<article>
<p>col 1 of 3</p>
</article>
</div>
<div>
<article>
<p>col 2 of 3</p>
</article>
</div>
<div>
<article>
<p>col 3 of 3</p>
</article>
</div>
</section>




</body>
</html>

CSS

* {margin:0;padding:0;}
.row {display:block;position:relative;clear:both;}
.row>* ,.gold>* {display:block;position:relative;clear:both;float:left;clear:none;}
.row>*:empty, .gold>*:empty {width:0px;}

.row>:nth-last-child(n+1):nth-child(n+2) {width:33.33%;} 
.row>:nth-last-child(n+1):nth-child(n+1) {width:50%;} 
.row>:nth-last-child(1):nth-child(1) {width:100%;} 


article {margin:.5em;border:1px solid green;border-radius:.3em;padding:.5em; }
.gold article {background-color:gold;}