html_css模拟端午赛龙舟运动

文章目录

    • ⭐前言
      • 💖 样式布局
      • 💖 添加龙舟
      • 💖 添加css_animation运动
    • ⭐结束

⭐前言

大家好,我是yma16,本期给大家分享css实现赛龙舟运动。

💖 样式布局

风格:卡通
首先采用一张包括水元素的照片作为背景

<!DOCTYPE html>
<html><head><meta charset="utf-8"><title>annimation</title><style>* {margin: 0;padding: 0;}body {width: 100vw;height: 100vh;background: url(./background.jpg);background-repeat: no-repeat;background-size: cover;display: grid;grid-template: 1fr/1fr;}</style></head><body></body>
</html>

背景图和龙舟的布局
background

💖 添加龙舟

使用ul的li元素配置龙舟属性添加龙舟图片

<!DOCTYPE html>
<html><head><meta charset="utf-8"><title>annimation</title><style>* {margin: 0;padding: 0;}body {width: 100vw;height: 100vh;background: url(./background.jpg);background-repeat: no-repeat;background-size: cover;display: grid;grid-template: 1fr/1fr;}.box {margin: 0 auto;}ul {display: block;position: absolute;top: 300px;left:0;}li {text-align: center;color: #000;line-height: 80px;text-transform: uppercase;height: 80px;width: 200px;opacity: 1;color: #fff;}.li-boat {height: 300px;width: 300px;background: url(./boat.png);background-repeat: no-repeat;background-size: cover;}</style></head><body><div class='box'><ul><li><div class="li-boat"></div></li><li><div class="li-boat"></div></li><li><div class="li-boat"></div></li><li><div class="li-boat"></div></li><li><div class="li-boat"></div></li></ul></div></body>
</html>

boat

💖 添加css_animation运动

水平移动

@keyframes move {from {transform: translateX(0vh);}to {transform: translateX(80vh);}
}li:nth-child(1) {animation-timing-function: ease;
}li:nth-child(2) {animation-timing-function: ease-in;
}li:nth-child(3) {animation-timing-function: ease-in-out;
}li:nth-child(4) {animation-timing-function: ease-out;
}li:nth-child(5) {animation-timing-function: linear;
}

完整的代码如下

<!DOCTYPE html>
<html><head><meta charset="utf-8"><title>annimation</title><style>* {margin: 0;padding: 0;}body {width: 100vw;height: 100vh;background: url(./background.jpg);background-repeat: no-repeat;background-size: cover;display: grid;grid-template: 1fr/1fr;}.box {margin: 0 auto;}ul {display: block;position: absolute;top: 300px;left: 0;}li {text-align: center;color: #000;line-height: 80px;text-transform: uppercase;height: 80px;width: 200px;animation-name: move;animation-duration: 12s;animation-iteration-count: infinite;transform: translateY(80vh);opacity: 1;color: #fff;}.li-boat {height: 300px;width: 300px;background: url(./boat.png);background-repeat: no-repeat;background-size: cover;}@keyframes move {from {transform: translateX(0vh);}to {transform: translateX(150vh);}}li:nth-child(1) {animation-timing-function: ease;}li:nth-child(2) {animation-timing-function: ease-in;}li:nth-child(3) {animation-timing-function: ease-in-out;}li:nth-child(4) {animation-timing-function: ease-out;}li:nth-child(5) {animation-timing-function: linear;}.title{width:auto;height: 50px;text-align: center;margin: 0 auto;color: rgb(89, 114, 189);background: #fff;font-size: 32px;font-weight: bold;}</style></head><body><div class='title'><img src="boat.png" height="30px"/>端午节赛龙舟活动<img src="boat.png" height="30px"/></div><div class='box'><ul><li><div class="li-boat"></div></li><li><div class="li-boat"></div></li><li><div class="li-boat"></div></li><li><div class="li-boat"></div></li><li><div class="li-boat"></div></li></ul></div></body>
</html>

效果如下
在这里插入图片描述

inscode的代码如下

⭐结束

本文分享结束!
💖感谢你的阅读💖
如有更好的意见欢迎指出!
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/4046.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

docker安装rabbitMQ,JAVA连接进行生产和消费,压测

1.docker安装 docker安装以及部署_docker bu shuminio_春风与麋鹿的博客-CSDN博客 2.doker安装rabbitMQ 使用此命令获取镜像列表 docker search rabbitMq 使用此命令拉取镜像 docker pull docker.io/rabbitmq:3.8-management 这里要注意&#xff0c;默认rabbitmq镜像是…

【MySQL】表的操作

目录 一、创建表 1、创建规则 2、创建案例 二、查看表结构 三、修改表 1、更改表名 2、 向表中插入数据 3、在表中添加字段 4、修改字段属性 5、从表中删除字段 6、修改字段名字 四、删除表 一、创建表 1、创建规则 CREATE TABLE table_name (field1 datatype,fi…

【C++】C++关于异常的学习

文章目录 C语言传统的处理错误的方式一、异常的概念及用法二、自定义异常体系总结 C语言传统的处理错误的方式 传统的错误处理机制&#xff1a; 1. 终止程序&#xff0c;如 assert &#xff0c;缺陷&#xff1a;用户难以接受。如发生内存错误&#xff0c;除 0 错误时就会终止…

PyQt中数据库的访问(一)

访问数据库的第一步是确保ODBC数据源配置成功&#xff0c;我接下来会写数据源配置的文章&#xff0c;请继续关注本栏&#xff01; &#xff08;一&#xff09;数据库连接 self.DBQSqlDatabase.addDatabase("QODBC") self.DB.setDatabaseName("Driver{sqlServer…

chatGPT AI对话聊天绘画系统开发:打开人工智能AI社交聊天系统开发新时代

人工智能技术的快速发展和普及&#xff0c;催生了众多创新应用&#xff0c;其中&#xff0c;AI社交聊天系统成为当下市场的热门话题&#xff0c;本文将详细介绍开发属于自己的ChatGPT的过程&#xff0c;并探讨当下市场因Chat AI聊天系统所带来的影响性。 AI社交聊天系统的潜力与…

云原生(第一篇)k8s-组件说明

k8s是什么&#xff1f; go语言开发的开源的跨主机的容器编排工具&#xff1b;全称是kubernetes&#xff1b; k8s的组件&#xff1a; master&#xff1a; ①kube-apiserver 所有服务统一的访问入口&#xff0c;无论对内还是对外&#xff1b; ②kube-controller-manager 资源控…

C++11新特性 智能指针

智能指针 nuique_ptr特点不允许拷贝构造和赋值运算符重载-> () *unique_ptr 删除器仿写删除文件删除普通对象 shared_ptr特点示意图仿写shared_ptr删除器部分特化拷贝构造 移动构造 && 左值赋值 和移动赋值完整实现 weak_ptr特点weak_ptr 实现解决循环引用弱指针一个…

事务

事务回顾MySQL事务Spring事务实现编程式事务实现&#xff1a;声明式事务 Transactional 注解作用范围及名称&#xff08;value/transactionManager&#xff09;隔离级别&#xff1a;isolation超时时间&#xff1a;timeout修改只读事务指定异常异常捕获情况 事务失效场景Transac…

九、ElasticSearch 运维 -集群维度

1. 查看集群健康 用于简单的判断集群的健康状态&#xff0c;集群内的分片的分配迁移情况。 GET _cluster/health-------------------------Respond----------------------------- {"cluster_name" : "test-jie","status" : "green",…

【Python】 Windows上通过git bash执行python卡住的解决方法

解决方法 编辑 C:\Program Files\Git\etc\profile.d\aliases.sh&#xff0c;将python2.7改成python 编辑完成后&#xff0c;重启git bash, 输入python即可 参考 https://blog.csdn.net/ofreelander/article/details/112058975

List, Set, Ordered-SetHash

前言 本文小结Redis中List&#xff0c;Set&#xff0c;ZSet和Hash四种数据类型的&#xff0c;基本特点&#xff0c;使用场景和实现方式。 一、List 1. 基本特点 a. 作为数组&#xff0c;基于下标索引操作, 但支持正向索引和反向索引; b. 作为链表, 支持高效插入&#xff1b…

Nginx安装、卸载教程(含Window、Linux版、Docker版)

目录 一、下载 二、Linux版安装 2.1 编译安装之前 2.2 编译安装 2.3 启动Nginx 2.4 关于防火墙 2.5 安装成系统服务 三、Linux版卸载&#xff08;彻底&#xff09; 3.1 检查一下Nginx服务是否在运行 3.2 停止Nginx服务 3.3 查找、删除Nginx相关文件 3.4 再使用yum清…