JSFiddle - React, Tailwind, and code Playground
by Steven Senkus
HTML
<section class="main">
<ul class="ch-grid">
<li>
<div class="ch-item ch-item-1 ch-img-1">
<div class="ch-info">
<h3>Bear</h3>
<p>bear is hungry<a href="http://drbl.in/eODP">Link to bear</a>
</p>
</div>
</div>
</li>
<li>
<div class="ch-item ch-item-2 ch-img-2">
<div class="ch-info">
<h3>Cat</h3>
<p>Best ever <a href="http://drbl.in/eNXW">Internet link</a>
</p>
</div>
</div>
</li>
<li>
<div class="ch-item ch-item-3 ch-img-3">
<div class="ch-info">
<h3>Dog-like Animal</h3>
<p>Might be bird, <a href="http://drbl.in/eNXY">not sure</a>
</p>
</div>
</div>
</li>
</ul>
</section>
CSS
.ch-grid {
box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
margin: 20px 0 0 0;
padding: 30px;
list-style: none;
display: block;
text-align: center;
width: 100%;
overflow: hidden;
height: 220px;
}
.ch-grid:after, .ch-item:before {
content:'';
display: table;
}
.ch-grid:after {
clear: both;
}
.ch-grid li {
width: 180px;
height: 180px;
display: inline-block;
float:left;
}
.ch-grid {
list-style-type: none;
}
.ch-item {
width: 180px;
height: 200px;
position: relative;
cursor: default;
box-shadow: inset 0 0 0 0 rgba(255, 255, 255, 0.9), inset 0 0 0 16px rgba(255, 255, 255, 0.6), 0 0px 100px rgba(230,230,230, 0.6);
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
-ms-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.ch-img-1 {
background-image: url('http://placebear.com/200/200');
}
.ch-img-2 {
background-image: url('//placekitten.com/200/200');
}
.ch-img-3 {
background-image: url('//placeimg.com/200/200/animals');
}
.ch-info {
position: absolute;
width: 200px;
height: 200px;
opacity: 0;
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-o-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
-webkit-backface-visibility: hidden;
/*for a smooth font */
}
.ch-info h3 {
color: #fff;
text-transform: uppercase;
position: relative;
letter-spacing: 2px;
padding: 0 5px 0;
width: 150px;
margin: 50px auto 25px;
font-family:'Open Sans', Arial, sans-serif;
text-shadow: 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.3);
}
.ch-info p {
color: #fff;
padding: 10px 5px;
...