Created
March 14, 2013 11:23
-
-
Save cemerson/5160593 to your computer and use it in GitHub Desktop.
HTML: CSS callout notch
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
| // Callout box notch with CSS/HTML | |
| // CREDITS: | |
| // - Core from here: http://mrcoles.com/blog/callout-box-css-border-triangles-cross-browser/ | |
| // - The up/down tweak from me! :) | |
| // TODO: | |
| // - Add left/right and other variations? | |
| // The HTML | |
| <div class="callout"> | |
| This is a callout box! | |
| <b class="notch"></b> | |
| </div> | |
| // The CSS | |
| .callout { | |
| position: relative; | |
| margin: 18px 0; | |
| padding: 18px 20px; | |
| background-color: #eef4f9; | |
| /* easy rounded corners for modern browsers */ | |
| -moz-border-radius: 6px; | |
| -webkit-border-radius: 6px; | |
| border-radius: 6px; | |
| } | |
| .callout .notch { | |
| position: absolute; | |
| left: 20px; | |
| margin: 0; | |
| border-top: 0; | |
| border-left: 10px solid transparent; | |
| border-right: 10px solid transparent; | |
| padding: 0; | |
| width: 0; | |
| height: 0; | |
| /* ie6 height fix */ | |
| font-size: 0; | |
| line-height: 0; | |
| /* ie6 transparent fix */ | |
| _border-right-color: pink; | |
| _border-left-color: pink; | |
| _filter: chroma(color=pink); | |
| } | |
| .callout .notch.up { | |
| top: -8px; | |
| border-bottom: 8px solid #FFDF77; | |
| } | |
| .callout .notch.down { | |
| bottom: -8px; | |
| border-top: 8px solid #FFDF77; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment