JSFiddle - React, Tailwind, and code Playground
by Shidhin C R
HTML
<h2>A simple call out using CSS only ( Without using any background image ) </h2><br/>
<p>
Mouse over this <span id="link">Link</span>
</p>
<div class="tooltip">
<div class="content" >
This is my first example for a simple callout using CSS
</div>
<div class="callout-bg" ></div>
<div class="callout" ></div>
</div>
CSS
.tooltip{
margin:40px;
display:none;
}
#link{
color:blue;
cursor:pointer;
}
.content{
border:2px solid #fff;
border-radius:5px;
box-shadow:0 0 30px #000;
padding:10px;
height:20px;
color:#fff;
background-color:#000;
opacity:0.8;
}
.callout-bg{
height:0;
width:0;
margin-left:19px;
border-left: 12px solid transparent;
border-right: 12px solid transparent;
border-top:11px solid #fff;
border-bottom:none;
margin-top:0px;
opacity:0.8;
}
.callout{
height:0;
width:0;
margin-left:20px;
border-left: 11px solid transparent;
border-right: 11px solid transparent;
border-top:10px solid #000;
border-bottom:none;
margin-top:-13px;
opacity:0.8;
}
JavaScript
$("#link").bind("mouseenter",function(){
$(".tooltip").fadeIn();
}):