吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1849|回复: 4
收起左侧

[学习记录] HTML+CSS我也在学习

[复制链接]
fuemng 发表于 2020-12-28 15:53
index.html<!DOCTYPE html><html lang="zh-CN">    <head>        <meta charset="UTF-8" />        <meta name="viewport" content="width=device-width, initial-scale=1.0" />        <title>动画</title>        <link rel="stylesheet" href="css/index.css" />    </head>    <body>        <div class="loading"></div>        <audio src="./mp3/双笙,V.K克 - 纯白.mp3" controls></audio>    </body></html>
index.css* {
    /* 初始化 取消页面的内外边距 */
    padding: 0;
    margin: 0;
}
body {
    /* 弹性布局 让页面元素垂直+水平居中 */
    display: flex;
    justify-content: center;
    align-items: center;
    /* 让页面始终占浏览器总高 */
    height: 100vh;
    background-color: #222;
}
.loading {
    /* 定位 */
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    /* 只需要将其它的边的颜色设为透明就好 */
    border: 3px solid transparent;
    /* 我们需要隐藏其它三条边只显示一条边 */
    border-top-color: #9370db;
    animation: rotate 2s linear infinite;
}
.loading::before {
    content: "";
    position: absolute;
    top: 5px;
    right: 5px;
    bottom: 5px;
    left: 5px;
    /* 这边也是一样 用伪元素做边框 */
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #ba55d3;
    animation: rotate 3s linear infinite;
}
.loading::after {
    content: "";
    position: absolute;
    top: 15px;
    right: 15px;
    bottom: 15px;
    left: 15px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #f0f;
    /* 动画 时长 linear是匀速运动 infinite 是无限次运动 */
    animation: rotate 1.5s linear infinite;
}
/* 下面定义一下动画 */
@keyframes rotate {
    0% {
        transform: rotate(0);
    }
    100% {
        /* 顺时针旋转360度 */
        transform: rotate(360deg);
    }
}


imag

imag

免费评分

参与人数 1吾爱币 +1 收起 理由
我是一个外星人 + 1 谢谢@Thanks!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

我心飞翔1995 发表于 2020-12-28 16:11
发错区了
ITNET 发表于 2020-12-28 17:12
alxad 发表于 2020-12-28 17:48
暗狱 发表于 2020-12-28 22:15
看不太懂
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止回复与主题无关非技术内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-6-1 11:05

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表