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

css画一个提示框

时间:2018-11-05 15:16:43      阅读:150      评论:0      收藏:0      [点我收藏+]

标签:line   text   width   inline   提示框   osi   技术分享   size   tran   

用css画一个如下图的提示框:
技术分享图片

代码如下:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .dialog{
            display:inline-block;
            padding:10px;
            border-radius: 4px;
            z-index: 2000;
            font-size: 12px;
            border:1px solid #303133;
            position: relative;
            top: 30px;
            left:50px;
        }
        .dialog .dialog_ico{
            position: relative;
            top: -31px;
        }

        .dialog_ico:after,.dialog_ico:before{
            content:‘‘;
            display:block;
            position:absolute;
            border-style:solid;
            border-width:10px;
        }
        .dialog_ico:before{
            border-color:black transparent transparent  transparent;
            left:20px;
            top:42px;
        }
        .dialog_ico:after{
            border-color:#fff transparent transparent  transparent;
            left:20px;
            top:41px;
        }
    </style>
</head>
<body>
    <div class="dialog">
        <span class="dialog_text">这是提示框</span>
        <div class="dialog_ico"></div>
    </div>
</body>
</html>

css画一个提示框

标签:line   text   width   inline   提示框   osi   技术分享   size   tran   

原文地址:https://www.cnblogs.com/fangnianqin/p/9909105.html

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