自定义布局,显示红点功能(类似未读消息数量)

https://blog.csdn.net/lvmingci/article/details/78781622

css 样式参考

https://blog.csdn.net/Wonder233/article/details/80613902

https://blog.csdn.net/weixin_36485956/article/details/78314186

--个人实现

<!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; */
        }
        .tip {
            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;
            position:relative;
            left: 70px;
            
        }
        .msg{
        position:relative;
        top: 10px;
        left: 15px
        }
    </style>
</head>

<body>
    <div style="width:80px;height:50px;background-color:yellow;position:relative;">
    <div class="tip">1</div>
    <span class="msg">消息</span>
    </div><br/>
    <div class="tip">95</div><br/>
    <div class="tip">99+</div>
</body>

</html>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值