当前位置:Gxlcms > html代码 > 分享一段html在消息按钮上增加数量角标的实现代码

分享一段html在消息按钮上增加数量角标的实现代码

时间:2021-07-01 10:21:17 帮助过:54人阅读

这篇文章主要介绍了html在消息按钮上增加数量角标的实现代码,需要的朋友可以参考下

html代码:

<a  onclick="goMessage();" style="width: 60px;height: 100%;color: white;background: transparent;" href="#" class="easyui-linkbutton" data-options="iconCls:'fa fa-bell-o fa-2x',size:'large',iconAlign:'top'">消息<span id="msgNum" class="ii">4</span></a>

css代码:

/*角标 */
    .ii{
        display: none;
        background: #f00;
        border-radius: 50%;
        width: 20px;
        height: 20px;
        top: 5px;
        right: 0px;
        position: absolute;
        text-align: center;
        color: #FFF;
        z-index: 99999;
    }

js代码:

实现效果:

这里写图片描述

以上就是分享一段html在消息按钮上增加数量角标的实现代码的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行