css 样式 小红点提醒

很多网站,会有未读信息的提醒(如下图:)

这里的样式主要用到定位  

文档链接:https://www.w3school.com.cn/cssref/pr_class_position.asp

<div class="posttitle1">
     <div class="posttitle1l">
        <img src="../../../../../../r/cms/www/xasrcwFront/images/resumeicon.png">
     </div>
     <!-- 提醒 -->
     <div v-if="unreadResume>0" class="unreadResumeWarning">
          <span class="unreadResumeCount">{{unreadResume}}</span>
     </div>
     <div class="posttitle1r">
          <a :href="apiHost+'firm/administration'" target="_blank">
               查看简历
          </a>
     </div>
</div>

unreadResume是自定义变量(整型),当未读的信息大于0时,提醒的小红点才会出现; 

父级盒子设置css    position: relative;

css样式如下

.posttitle1 {
    width: 213px;
    height: 60px;
    margin: 0 auto;
    margin-top: 9%;
    border-bottom: 1px solid #E6E6E6;
    position: relative;
}

.unreadResumeWarning {
    width: 14px;
    height: 14px;
    border-radius: 7px;
    background-color: #FF3B30;
    position: absolute;
    left: 28px;
    top: 10px;
}

.unreadResumeCount {
    display: block;
    width: 100%;
    height: 14px;
    line-height: 14px;
    text-align: center;
    color: #fff;
    font-size: 12px;
}

  • 4
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值