layui成功提示的自定义样式

layer.msg提示成功样式自定义


layui默认的消息提示方法layer.msg样式如下:
在这里插入图片描述

根据UI的要求需要优化成如下图:
在这里插入图片描述
查阅layui文档发现,layer方法可以自定义class!链接: https://www.iconfont.cn/collections/index?spm=a313x.7781069.1998910419.4.
在这里插入图片描述
增加css如下(绿色对勾图标为插入的图片,可以在官方图标库中下载https://www.iconfont.cn/collections/index?spm=a313x.7781069.1998910419.4):

/*自定义layui-layer.msg成功提示框样式*/
body .success-class{
    min-width: 150px;
    min-height: 110px;
    border: 1px solid #2EB773;
    box-shadow: none;
    background-color: #EDFAE9;
    border-radius: 5px;
    color: #2EB773;
}
body .success-class .layui-layer-padding {
    padding: 0px;
    text-align: center;
    top: 8px;
    padding-top: 60px;
}
body .success-class .layui-layer-content .layui-layer-ico {
    background-image: url(../images/checkMgr/paysuccessimg.png);
    background-repeat: no-repeat;
    background-position: top;
    background-size: 20%;
    width: 150px;
    left: 0px;
}

使用layer.msg时加上属性skin添加自定义的类

layer.msg('提交成功', {icon: 1,skin: 'success-class'});
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值