码迷,mamicode.com
首页 > Web开发 > 详细

css对话气泡

时间:2016-02-27 12:12:33      阅读:240      评论:0      收藏:0      [点我收藏+]

标签:

<!doctype html>
<html>
  <head>
  <meta charset="UTF-8">
  <title>css对话气泡</title>

  <style>
  .test-div{
    position: relative;
    width:150px;
    height: 36px;
    border:black 1px solid;
    border-radius:5px;
    background: rgba(245,245,245,1) ;

  }
  .test-div:before,.test-div:after{
    content: "";
    display: block;
    position: absolute;
    top:8px;
    width: 0;
    height: 0;
    border:6px transparent solid;
   }
  .test-div:before{
    left:-11px;
    border-right-color: rgba(245,245,245,1);
    z-index:1;

      }
  .test-div:after{
    left:-12px;
    border-right-color: rgba(0,0,0,1);
    z-index: 0 ;

  }

/*前后各画一个三角形,通过改变位置和堆叠顺序,使两个三角形部分覆盖重合*/
  </style>
</head>
<body>
  <div class="test-div"></div>
</body>
</html>

 

css对话气泡

标签:

原文地址:http://www.cnblogs.com/shelly1072/p/5222434.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!