HTML+CSS3 —— To:Kobe——彩虹漸變

在這裏插入圖片描述


H部分:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>彩虹背景捏</title>
    <link href="https://fonts.font.im/css?family=Modern+Antiqua" rel="stylesheet">
    <link rel="stylesheet" href="css/5-24.css">
</head>

<body>
    <div class="text">
        KoBe·Bryant
    </div>
</body>

</html>

css部分:

* {
    margin: 0;
    padding: 0;
}

body {
    background-image: linear-gradient(125deg, #e74c3c, #e67e22, #f1c40f, #2ecc71, #16a085, #3498db, #9b59b6);
    background-size: 400%;
    animation: kobe 15s infinite;
}

.text {
    /* font-size: 95px; */
    text-align: center;
    margin: 350px 0;
    font-family: 'Modern Antiqua', cursive;
    /* color: #ffcc66; */
    color: #2c3e50;
    font-weight: 700;
    font-size: 22px;
}

@keyframes kobe {
    0% {
        background-position: 0 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0 50%;
    }
}

分享

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章