JSFiddle - React, Tailwind, and code Playground
by Zero Fx
HTML
<div class="wrap">
<a href="#" class="link">TEST !!!</a>
<div class="myblok">
</div>
</div>
CSS
* {
margin: 0;
padding: 0;
}
html,body {
width: 100%;
height: 100%;
background-color: #cccccc;
}
.wrap {
width: 800px;
height: 100%;
margin: 0 auto;
overflow: hidden;
background-color: #313131;
}
.link {
background-color: #fa9100;
border-radius: 10px;
color: #fff;
display: block;
font: italic bold 16px "Arial";
width: 100px;
height: 30px;
text-align: center;
text-decoration: none;
padding-top: 10px;
margin: 0 auto;
position: relative;
top: 55px;
}
.link:hover {
background-color:#D9D900;
}
.myblok {
width: 150px;
height: 150px;
background-color: #22FF00;
margin: 0 auto;
position: relative;
clear: both;
top: 100px;
display: none;
}
JavaScript
$(document).ready(function(){
$('.myblok-link__close').on('click',function(){
$('.myblok-block').fadeOut(300);
});
});