Skip to content

Instantly share code, notes, and snippets.

@cemerson
Created March 14, 2013 11:23
Show Gist options
  • Select an option

  • Save cemerson/5160593 to your computer and use it in GitHub Desktop.

Select an option

Save cemerson/5160593 to your computer and use it in GitHub Desktop.
HTML: CSS callout notch
// 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