Created
August 29, 2012 02:35
-
-
Save yangg/3506247 to your computer and use it in GitHub Desktop.
Amazing CSS bubble
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Amazing CSS3 bubble | |
| */ | |
| body { font:14px/1.6 Droid Sans,Verdana,Lucida Grande,Verdana,Microsoft YaHei; } | |
| .bubble-wrapper { position: absolute; } | |
| .bubble { position: absolute; border: 1px solid #53a8c9; | |
| width: 100%; height: 100%; padding: 10px; | |
| border-radius: 5px; box-shadow: 0 0 5px 1px #dbf6ff; | |
| background: #FFF; background: -webkit-linear-gradient(bottom, #e8f5ff, #fff 20px); | |
| } | |
| .bubble-wrapper .arrow, .bubble-wrapper .arrow-inner { position: absolute; height: 0; width: 0; font-size: 0; border: 10px dashed transparent; } | |
| /* top */ | |
| .bubble-top .bubble { top: 20px; } | |
| .bubble-top .arrow, .bubble-top .arrow-inner { border-bottom-color: #53a8c9; border-bottom-style: solid; } | |
| .bubble-top .arrow-inner { border-bottom-color: #FFF; top: -9px; left: -10px; } | |
| /* right */ | |
| .bubble-right .arrow { right: -42px; } | |
| .bubble-right .arrow, .bubble-right .arrow-inner { border-left-color: #53a8c9; border-left-style: solid; } | |
| .bubble-right .arrow-inner { border-left-color: #FFF; top: -10px; left: -11px; } | |
| /* bottom */ | |
| .bubble-bottom .arrow { bottom: -42px; } | |
| .bubble-bottom .arrow, .bubble-bottom .arrow-inner { border-top-color: #53a8c9; border-top-style: solid; } | |
| .bubble-bottom .arrow-inner { border-top-color: #FFF; top: -11px; left: -10px; } | |
| /* left */ | |
| .bubble-left .bubble { left: 20px; } | |
| .bubble-left .arrow, .bubble-left .arrow-inner { border-right-color: #53a8c9; border-right-style: solid; } | |
| .bubble-left .arrow-inner { border-right-color: #FFF; top: -10px; left: -9px; } | |
| .bubble-wrapper { height: 120px; width: 400px; left: 100px; } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <a href="http://jonrohan.me/guide/css/creating-triangles-in-css/">Creating Triangles in CSS</a> | |
| <div class="bubble-wrapper bubble-top" > | |
| <div class="bubble">Amazing CSS3 bubble <br/> Top | |
| </div> | |
| <div class="arrow" style="left: 35px;"><div class="arrow-inner"></div></div> | |
| </div> | |
| <div class="bubble-wrapper bubble-right" style="top: 210px;" > | |
| <div class="bubble">Right</div> | |
| <div class="arrow" style="top: 55px;"><div class="arrow-inner"></div></div> | |
| </div> | |
| <div class="bubble-wrapper bubble-bottom" style="top:380px;" > | |
| <div class="bubble">Bottom</div> | |
| <div class="arrow" style="left: 135px;"><div class="arrow-inner"></div></div> | |
| </div> | |
| <div class="bubble-wrapper bubble-left" style="top: 560px; left: 80px;" > | |
| <div class="bubble">Left</div> | |
| <div class="arrow" style="top: 55px;"><div class="arrow-inner"></div></div> | |
| </div> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment