试试这个最简单的实现:
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;
top: -10px;
left: 20px;
margin: 0;
border-top: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 10px solid #eef4f9;
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);
}
HTML:
<div class="callout">
This is a callout box!
<b class="notch"></b>
</div>
现场演示:http: //jsfiddle.net/yCw3T/