动态背景颜色渐变HTML


html 复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>SSOSN</title>
    <link rel="shortcut icon" href="../img/cat.ico">
    <meta name="referrer" content="no-referrer">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="viewport"
          content="width=device-width,initial-scale=1.0,user-scalable=no,minimum-scale=1,maximum-scale=1">
    <meta HTTP-EQUIV="pragma" content="no-cache">
    <meta HTTP-EQUIV="Cache-Control" content="no-cache, must-revalidate">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
    <meta HTTP-EQUIV="expires" content="0">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover"/>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="full-screen" content="yes">
    <meta name="x5-fullscreen" content="true">
    <meta name="apple-mobile-web-app-capable" content="yes"/>
</head>
<style>
    *{
        background: #000;
        margin: 0;
        padding: 0;
        overflow:hidden;
        -moz-user-select: none;
        -khtml-user-select: none;
        user-select: none;
        -ms-overflow-style: none;
    }
    /*动态渐变背景*/
    .gradient {
        /* 设置容器尺寸 - 原理1 */
        width: 100vw;
        height: 100vh;
        /* 背景渐变色 - 原理2 */
        background: linear-gradient(-45deg, #c45839, #c2396c, #359dc4, #34bd9c);
        /* 背景尺寸 - 原理3 */
        background-size: 600% 600%;
        /* 循环动画 - 原理4 */
        animation: gradientBG 10s ease infinite;
    }
    /* 动画,控制背景 background-position */
    @keyframes gradientBG {
        0% {
            background-position: 0% 50%;
        }
        50% {
            background-position: 100% 50%;
        }
        100% {
            background-position: 0% 50%;
        }
    }
</style>
<body>
<!-- 容器 -->
<div class="gradient"></div>
</body>
</html>
相关推荐
data analyse 4565 分钟前
埋点工具的私有化部署成本高吗?
前端·数据分析·github
data analyse 4561 小时前
埋点工具的埋点查询语言难学吗?
前端·数据分析
DianSan_ERP1 小时前
多平台订单自动下载与回传的技术实现:从消息推送到状态闭环引言
java·linux·服务器·前端·网络·架构·自动化
恋猫de小郭1 小时前
Shopify 回应为什么从 RN 回到原生,为什么不用 KMP ?
android·前端·flutter
小蜗 strong2 小时前
和电脑猜拳(随机程序应用)
服务器·前端·python
下家3 小时前
为了脱离前端鄙视链,于是自己写个框架 - React 党看完沉默了
前端·前端框架
zhiyouTech3 小时前
从“被看见“到“被信任“:关于信源评级机制的一点观察
大数据·前端·人工智能
Hashan3 小时前
Vibe Coding 下前后端怎么对接接口?后端不给力的兜底方案
前端·后端·vibecoding
你挚爱的强哥4 小时前
【sgKeyboard】自定义组件:虚拟键盘
前端·javascript·计算机外设
锅里游的鱼吖4 小时前
echarts自定义折线图
前端·javascript·数据库