如果功能区是问题,那么在空(0大小)元素(可以使用:after伪元素添加)上使用边框.
HTML
<div id="content">
<div id="ribbon"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
#content{
background-color:#77c;
width:300px;
height:200px;
position:relative;
}
#ribbon{
position:absolute;
width:80px;
height:30px;
right:-20px;
top:50px;
background-color:#999;
}
#ribbon:after{
content:'';
width:0;
height:0;
border-color: transparent transparent #666 #666;
border-style:solid;
border-width:5px 10px;
position:absolute;
right:0;
top:-10px;
}
Run Code Online (Sandbox Code Playgroud)
演示 http://jsfiddle.net/gaby/zJPhy/