其他分享
首页 > 其他分享> > css样式修改-悬浮数字

css样式修改-悬浮数字

作者:互联网

代码实现

 

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body {
            text-align: center;
        }
        div{
           position: relative;
           width:100px;
           height:100px;
           background:blue;
           margin-top: 10px;
           margin-left: 20px;
           box-shadow: 10px 10px 5px #888888;
        }

        .tip {
            position: absolute;
            min-width: 20px;
            height: 20px;
            background: red;
            box-sizing: border-box;
            color: white;
            font-size: 10px;
            text-align: center;
            line-height: 20px;
            padding: 0 5px;
            border-radius: 10px;
            display: inline-block;
            margin-left: 35px;
            top:-5px;
        }
    </style>
</head>

<body>
    <div>
        <p class="tip">25</p>
    </div>
</body>

</html>

 

标签:box,悬浮,height,样式,5px,10px,20px,margin,css
来源: https://www.cnblogs.com/1314520xh/p/15862051.html