网站弹出公告代码

雨梦
2023-01-01 / 1 评论 / 59 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2023年01月05日,已超过76天没有更新,若内容或图片失效,请留言反馈。

其实很简单,把下面的代码放到网站首页/body标签前即可。
具体代码如下:

<!-- 弹窗代码开始 -->
<div class="web_notice" style="position: fixed;top: 0;left: 0;width: 100%;height: 100%;background: rgba(0,0,0,0.3);z-index: 99999;">
<div style="position: fixed;top: 50%;left: 50%;width: 550px;background: #FFF;transform: translate(-50%, -50%);border-radius: 40px;padding: 50px 40px;">
<h3 style="font-weight: bold;text-align: center;font-size: 30px;
">网站通知</h3><div style="font-size: 16px;margin-top: 26px;line-height: 30px;color: #999;
">测试弹窗</div><a style="display: block;background: #98a3ff;color: #FFF;text-align: center;font-weight: bold;font-size: 19px;line-height: 60px;margin: 0 auto;margin-top: 45px;border-radius: 32px;width: 80%;" onclick="javascript:document.querySelector('.web_notice').remove()">我知道了</ a></div></div>
<!-- 弹窗代码结束 -->
4

评论 (1)

取消
  1. 头像
    雨梦 作者
    Windows X64 · QQ Browser

    表情

    回复