欢迎来到DIVCSS5查找CSS资料与学习DIV CSS布局技术!
  HTML代码
 
  <divclass="balloon-left">
 
  左边
 
  </div>
 
  CSS代码
 
  .balloon-left{
 
  position:relative;
 
  display:inline-block;
 
  padding:015px;
 
  width:auto;
 
  min-width:150px;
 
  height:40px;
 
  line-height:34px;
 
  text-align:center;
 
  background:#44FF44;
 
  border:3pxsolid#000000;
 
  z-index:0;
 
  }
 
  接着,我们使用:before来制作箭头部分,用:after来制作箭头的边
 
  CSS代码
 
  .balloon-left:before{
 
  border-style:solid;
 
  border-width:10px10px10px0;
 
  border-color:transparent#44FF44transparenttransparent;
 
  content:"";
 
  position:absolute;
 
  top:50%;left:-8px;
 
  margin-top:-9px;
 
  display:block;
 
  width:0px;
 
  height:0px;
 
  z-index:0;
 
  }
 
  .balloon-left:after{
 
  border-style:solid;
 
  border-width:11px11px11px0;
 
  border-color:transparent#000000transparenttransparent;
 
  content:"";
 
  position:absolute;
 
  top:50%;left:-12px;
 
  margin-top:-10px;
 
  display:block;
 
  width:0px;
 
  height:0px;
 
  z-index:-1;
 
  }







本文转载自中文网

如需转载,请注明文章出处和来源网址:http://www.divcss5.com/css3-style/c56382.shtml