首页 > Web开发 > 详细

css 绘制对话框三角符号

时间:2016-11-18 21:33:20      阅读:160      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Test</title>
    <style>
        .tip {
            position: relative;
            background-color: deepskyblue;
            margin: 20px auto;
            width: 246px;
            height: 43px;
            line-height: 43px;
            color: white;
            text-align: center;
            border-radius: 10px;
            font-family: sans-serif;
        }
        .tip:after {
            content: ‘‘;
            position: absolute;
            width: 0;
            height: 0;
            border: 8px solid;
        }
        .top:after {
            border-bottom-color: deepskyblue;
            left: 50%;
            bottom: 100%;
            margin-left: -15px;
        }
        .right:after {
            border-left-color: deepskyblue;
            left: 100%;
            top: 50%;
            margin-top: -7px;
        }
        .bottom:after {
            border-top-color: deepskyblue;
            top: 100%;
            left: 50%;
            margin-left: -15px;
        }
        .left:after {
            border-right-color: deepskyblue;
            top: 50%;
            right: 100%;
            margin-top: -9px;
        }
    </style>
</head>
<body>
    <div class="tip top">top</div>
    <div class="tip bottom">bottom</div>
    <div class="tip left">left</div>
    <div class="tip right">right</div>
</body>
</html>
 

css 绘制对话框三角符号

原文:http://www.cnblogs.com/jintaostudy/p/6078737.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!