Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Tooltip without shadow</strong></p> <p><div class="snippet" data-lang="js" data-hide="true"> <div class="snippet-code snippet-currently-hidden"> <pre class="snippet-code-css lang-css prettyprint-override"><code>.abubble { position: relative; border: 1px solid #a0c7ff; width: 100px; height: 100px; } .ashadow { position: absolute; display: inline-block; background: transparent; width: 10px; height: 10px; left: 50px; top: 100px; -moz-box-shadow: 0px 10px 30px #000; -webkit-box-shadow: 0px 10px 30px #000; box-shadow: 0px 10px 30px #000; } .atail { position: absolute; display: inline-block; border-width: 20px; border-style: solid; border-color: #a0c7ff transparent transparent transparent; width: 0px; height: 0px; left: 30px; top: 100px; } .atail2 { position: relative; display: inline-block; border-width: 19px; border-style: solid; border-color: #fff transparent transparent transparent; width: 0px; height: 0px; left: -19px; top: -20px; } .anothertail { background-image: url(http://static.jqueryfordesigners.com/demo/images/coda/bubble-tail2.png); display: block; height: 29px; width: 30px; }</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;How do I get this effect with only CSS? &lt;br /&gt; &lt;div class="anothertail"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class="abubble"&gt; &lt;div class="atail"&gt; &lt;div class="atail2"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;</code></pre> </div> </div> </p> <p><a href="http://jsfiddle.net/qar7r/" rel="nofollow">Fiddle Demo</a></p> <hr> <p><strong>With Shadow</strong> (looks bit weird in WebKit... gotta optimize it I guess): </p> <p><div class="snippet" data-lang="js" data-hide="true"> <div class="snippet-code snippet-currently-hidden"> <pre class="snippet-code-css lang-css prettyprint-override"><code>.abubble { position: relative; border: 1px solid #a0c7ff; width: 100px; height: 100px; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; } .ashadow { position: absolute; display: inline-block; background: transparent; width: 10px; height: 10px; left: -5px; top: -16px; -moz-box-shadow: 0px 10px 20px #000; -webkit-box-shadow: 0px 10px 20px #000; box-shadow: 0px 10px 20px #000; } .atail { position: absolute; display: inline-block; border-width: 20px; border-style: solid; border-color: #a0c7ff transparent transparent transparent; width: 0px; height: 0px; left: 30px; top: 100px; } .atail2 { position: relative; display: inline-block; border-width: 19px; border-style: solid; border-color: #fff transparent transparent transparent; width: 0px; height: 0px; left: -19px; top: -20px; } .anothertail { background-image: url(http://static.jqueryfordesigners.com/demo/images/coda/bubble-tail2.png); display: block; height: 29px; width: 30px; }</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;How do I get this effect with only CSS? &lt;br /&gt; &lt;div class="anothertail"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class="abubble"&gt; &lt;div class="atail"&gt; &lt;div class="ashadow"&gt;&lt;/div&gt; &lt;div class="atail2"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;</code></pre> </div> </div> </p> <p><a href="http://jsfiddle.net/ZFpHU/3/" rel="nofollow">Demo 1</a>, <a href="http://jsfiddle.net/ZFpHU/1/" rel="nofollow">Demo 2</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload