CSS特效005:绘制一个环环相扣的五个环

news/2024/9/12 11:15:08

css实战中,怎么制作这样的一个环环相扣的五个环呢? 绘制五个圈圈很容易,关键是要环环相扣,尤其要注意环环相交部分的处理。这里要用到transform-style: preserve-3d; 和 transform: rotateY( 1deg ) 等关键的css技术。

效果图

在这里插入图片描述

源代码

/*
* @Author: 大剑师兰特(xiaozhuanlan),还是大剑师兰特(CSDN)
* @此源代码版权归大剑师兰特所有,可供学习或商业项目中借鉴,未经授权,不得重复地发表到博客、论坛,问答,git等公共空间或网站中。
* @Email: 2909222303@qq.com
* @weixin: gis-dajianshi
* @First published in CSDN
* @First published time: 2023-11-11
*/
<template>
	<div class="container">
		<div class="top">
			<h3>绘制一个环环相扣的五环</h3>
			<div class="author">大剑师兰特, 还是大剑师兰特,gis-dajianshi</div>
		</div>
		<div class="dajianshi-rings">
			<div class="ring"></div>
			<div class="ring"></div>
			<div class="ring"></div>
			<div class="ring"></div>
			<div class="ring"></div>
		</div>

	</div>
</template>

<style scoped>
	.container {
		width: 1000px;
		height: 580px;
		margin: 50px auto;
		border: 1px solid green;
		position: relative;
	}

	.top {
		margin: 0 auto 0px;
		padding: 10px 0;
		background: plum;
		color: #fff;
	}

	.dajianshi-rings {
		width: 350px;
		height: 350px;
		position: relative;
		margin: 100px auto 0;
		transform-style: preserve-3d;
	}

	.ring {
		position: absolute;
		border: 12px solid;
		width: 100px;
		height: 100px;
		border-radius: 50%;
	}

	.ring:nth-child(1) {
		border-color: red;
		top: 0;
		left: 0;
		transform: rotateY( 1deg )/*3D效果,以y轴旋转*/
	}

	.ring:nth-child(2) {
		border-color: black;
		top: 0px;
		left: 130px;
		transform: rotateY( 1deg )
	}

	.ring:nth-child(3) {
		border-color: red;
		top: 0px;
		left: 260px;
		transform: rotateY( 1deg )
	}

	.ring:nth-child(4) {
		border-color: yellow;
		top: 60px;
		left: 60px;
		transform: rotateY( -1deg )
	}

	.ring:nth-child(5) {
		border-color: yellow;
		top: 60px;
		left: 190px;
		transform: rotateY( -1deg )
	}
</style>



http://lihuaxi.xjx100.cn/news/1776434.html

相关文章

C语言如何执行HTTP GET请求

在现代互联网时代&#xff0c;网络数据的获取和分析变得越来越重要。无论是为了研究市场趋势&#xff0c;还是为了收集信息进行数据分析&#xff0c;编写一个网络爬虫可以帮助我们自动化这一过程。在这篇文章中&#xff0c;我们将使用C语言和libcurl库来编写一个简单的网络爬虫…

53. 最大子序和 392.判断子序列 115.不同的子序列 583. 两个字符串的删除操作 72. 编辑距离

53. 最大子序和 题目&#xff1a; 给定一个整数数组&#xff0c;求最大连续子序列和。&#xff08;至少包含一个元素&#xff09; 示例: 输入: [-2,1,-3,4,-1,2,1,-5,4]输出: 6解释: 连续子数组 [4,-1,2,1] 的和最大&#xff0c;为 6意为为了连续最大负数都可以包含进来。…

conda添加清华镜像源

一、conda下载 https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ 显示所有channel conda config --show channels 二、添加清华镜像源 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --add channels https://…

划分VOC数据集,以及转换为划分后的COCO数据集格式

1.VOC数据集 LabelImg是一款广泛应用于图像标注的开源工具&#xff0c;主要用于构建目标检测模型所需的数据集。Visual Object Classes&#xff08;VOC&#xff09;数据集作为一种常见的目标检测数据集&#xff0c;通过labelimg工具在图像中标注边界框和类别标签&#xff0c;为…

Android jetpack compose 组件学习

官网地址&#xff1a;https://developer.android.com/jetpack/compose/tutorial?hlzh-cn 一、写一个 hello world 在New Project的时候选择Photo and Tablet里的Empty Compose Activity&#xff0c;如下所示&#xff1a; 打开这个project之后&#xff0c;可以看到MainActivit…

说一下vue2的响应式原理?

vue2采用数据代理数据劫持发布订阅模式的方法。 在初始化vue实例时&#xff0c;会把data对象和data对象的属性都添加到vm对象中&#xff0c;通过object.defineProperty()进行数据代理&#xff0c;用vm对象的属性来代理data对象的属性&#xff0c;并在Observer类中递归遍历data…

【扩散模型】实战:创建一个类别条件扩散模型

创建一个类别条件扩散模型 1. 配置和数据准备2. 创建一个以类别为条件的UNet模型3. 训练和采样 本文介绍一种给扩散模型添加额外条件信息的方法。具体地&#xff0c;将在MNIST数据集上训练一个以类别为条件的扩散模型。并且可以在推理阶段指定想要生成的是哪个数字。 1. 配置和…

csv文件导入mysql指定表中

csv文件导入mysql指定表中 mysql数据库准备指定表 准备导入的csv数据如下&#xff1a; sepaLengthsepalWidthpetalLengthpetalWidthlabel5.13.51.40.204.931.40.204.73.21.30.20…………… 准备导入的数据为151行5列的数据&#xff0c;其中第一行为标题行。 因此&#xff0…