码迷,mamicode.com
首页 > 其他好文 > 详细

巧用border特性实现聊天气泡效果

时间:2016-01-29 15:48:03      阅读:135      评论:0      收藏:0      [点我收藏+]

标签:

利用border特性,实现三角形,很简单,我们直接看效果:

技术分享

html:

<div class="bubble-container ">你好么
    <div class="bubble-tail"></div>
</div>

css:

.bubble-container {
            height: 100px;
            line-height: 100px;
            margin-bottom: 2em;
            padding-left: 2em;
            background: #3EC22D;
            position: relative;
            font-family: "微软雅黑";
            color: white;
            border-radius: 10px;
        }

        .bubble-container .bubble-tail {
            width: 0px;
            height: 0px;
            position: absolute;
            left: 50px;
            border-width: 15px;
            border-style: solid;
            border-color: #3EC22D transparent transparent transparent;
        }

 

巧用border特性实现聊天气泡效果

标签:

原文地址:http://www.cnblogs.com/shytong/p/5168896.html

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