JSFiddle - React, Tailwind, and code Playground
by Spokey
HTML
<div class='error' style='display:none'>I did something!</div>
<button>Do something!</button>
CSS
body, html {
height:100%;
width:100%;
min-height:100%;
padding:0;
margin:0;
}
.error {
width:200px;
height:20px;
height:auto;
position:absolute;
left:50%;
margin-left:-100px;
bottom:10px;
background-color: #383838;
color: #F0F0F0;
font-family: Calibri;
font-size: 20px;
padding:10px;
text-align:center;
border-radius: 2px;
-webkit-box-shadow: 0px 0px 24px -1px rgba(56, 56, 56, 1);
-moz-box-shadow: 0px 0px 24px -1px rgba(56, 56, 56, 1);
box-shadow: 0px 0px 24px -1px rgba(56, 56, 56, 1);
}
JavaScript
$('button').click(function () {
$('.error').stop().fadeIn(400).delay(3000).fadeOut(400); //fade out after 3 seconds
});