HTML纯代码给网页右下角增加弹窗视频代码(视频外链可自行准备也可使用随机视频API)

HTML纯代码给网页右下角增加弹窗视频代码(视频外链可自行准备也可使用随机视频API)

在这里插入图片描述

HTML代码如下:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 设置提醒框的整体样式 */
        .notification {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background-color: #f8f9fa;
            padding: 16px;
            border: 1px solid #ccc;
            border-radius: 4px;
        }
        /* 设置图片样式 */
        .notification img {
            width: 40px;
            height: 40px;
            margin-right: 16px;
        }
        /* 设置文字样式 */
        .notification p {
            color: #444;
            line-height: 24px;
        }
        /* 设置关闭按钮的样式 */
        .notification .closeButton {
            position: absolute;
            top: 0;
            right: 0;
            padding: 8px 12px;
            background-color: #ccc;
            color: #fff;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <!-- 提醒框内容 -->
    <div class="notification">
        <video class="video" style="height:200px;width:136px;" src="https://api.woeo.net/API/api-girl/index.php" controls autoplay></video>
        <p></p>
        <!-- 关闭按钮 -->
        <button class="closeButton">×</button>
    </div>
    <script>
        // 获取提醒框的 DOM 元素
        const notification = document.querySelector('.notification');
        // 获取关闭按钮的 DOM 元素
        const closeButton = document.querySelector('.notification .closeButton');
        // 添加点击事件监听器
        closeButton.addEventListener('click', () => {
            // 隐藏提醒框
            notification.style.display = 'none';
        });
    </script>
</body>
</html>

点击此处查看演示页面

点击此处下载源码

  • 9
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

宋佳乐

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值