1、旋转太极
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>太极</title>
<style>
* {
margin: 0;
padding: 0;
background: #ccc;
}
.taiji {
width: 0;
height: 300px;
border-left: 150px solid #000000;
border-right: 150px solid #FFFFFF;
border-radius: 50%;
animation: myRotate 2s linear infinite;
}
@keyframes myRotate{
from{transform: rotate(0deg);}
to{transform: rotate(360deg);}
}
.taiji::before {
display: block;
content: "";
background: white;
height: 50px;
width: 50px;
border-radius: 50%;
border: 50px solid #000000;
margin-left: -72px;
}
.taiji::after {
display: block;
content: "";
background: black;
height: 50px;
width: 50px;
border-radius: 50%;
border: 50px solid white;
margin-left: -72px;
}
</style>
</head>
<body>
<div class="taiji">
</div>
</body>
</html>
2、下拉菜单
.nav-bar li{
float: left;
}
.nav-bar > ul > li {
float: left;
padding: 0 10px;
}
.nav-bar > ul > li > a:hover {
color: #ff6700;
}
.nav-bar-list {
z-index: 750;
display: none;
position: absolute;
left: 0;
top: 100px;
width: 100%;
height: 229px;
background-color: #fff;
border-top: 1px solid #e0e0e0;
box-shadow: 0 3px 4px rgba(0, 0, 0, .18);
}
.nav-bar li:hover > .nav-bar-list {
display: block;
}
.nav-bar-list li{
line-height: normal;
border-right: 1px solid #eeeeee;
}
.nav-bar-list .name{
font-size: 12px;
color: #333333;
}
.nav-bar-list .price{
font-size: 12px;
color: #ff6700;
}
.nav-bar li a{
color: #333;
padding: 0 10px;
}
.nav-bar li a:hover{
color: #ff6700;
}
3、页面灰度化
/*页面灰度*/
html{
filter: grayscale(100%);
}
4、3D立方体旋转
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>一个旋转立方体的实现</title>
<style>
body {
perspective: 5000px;
}
.container {
width: 200px;
height: 200px;
margin: 300px auto;
position: relative;
transform-style: preserve-3d;
animation: myRotate 5s infinite linear;
}
@keyframes myRotate {
from {
transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}
to {
transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
}
}
.container>img {
width: 200px;
height: 200px;
position: absolute;
}
.container:hover >img:first-child {
transform: translateZ(-300px);
}
.container:hover >img:last-child {
transform: translateZ(100px);
}
.container:hover img:nth-child(2) {
transform: rotateY(-90deg) translateZ(100px);
}
.container:hover img:nth-child(3) {
transform: rotateX(90deg) translateZ(100px);
}
.container:hover img:nth-child(4) {
transform: rotateY(90deg) translateZ(100px);
}
.container:hover img:nth-child(5) {
bottom: -200px;
transform-origin: top;
transform: rotateX(-90deg) translateZ(100px);
}
.container>img:first-child {
transform: translateZ(-200px);
}
.container>img:last-child {
}
.container>img:nth-child(2) {
left: -200px;
transform-origin: right;
transform: rotateY(-90deg);
}
.container>img:nth-child(3) {
top: -200px;
transform-origin: bottom;
transform: rotateX(90deg);
}
.container>img:nth-child(4) {
right: -200px;
transform-origin: left;
transform: rotateY(90deg);
}
.container>img:nth-child(5) {
bottom: -200px;
transform-origin: top;
transform: rotateX(-90deg);
}
</style>
</head>
<body>
<div class="container">
<img src="../IMG/原神/01.jpg" alt="">
<img src="../IMG/原神/02.jpg" alt="">
<img src="../IMG/原神/03.jpg" alt="">
<img src="../IMG/原神/04.jpg" alt="">
<img src="../IMG/原神/05.jpg" alt="">
<img src="../IMG/原神/06.jpg" alt="">
</div>
</body>
</html>
5、发光按钮组
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>发光按钮</title>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
display: flex;
justify-content: center;
align-items: center;
gap: 100px;
background-color: black;
min-height: 100vh;
}
a:nth-child(1){
filter: hue-rotate(115deg);
}
a:nth-child(3){
filter: hue-rotate(270deg);
}
a{
position: relative;
padding: 10px 30px;
margin: 45px 0;
color: #ff0000;
text-decoration: none;
font-size: 20px;
overflow: hidden;
transition: .5s;
}
a:hover{
background-color: #ff0000;
color: #111;
box-shadow: 0 0 50px #ff0000;
transition-delay: .5s;
}
a::before{
content: '';
position: absolute;
top: 0;
left: 0;
width: 10px;
height: 10px;
border-left: 2px solid #ff0000;
border-top: 2px solid #ff0000;
transition: .5s;
}
a::after{
content: '';
position: absolute;
bottom: 0;
right: 0;
width: 10px;
height: 10px;
border-bottom: 2px solid #ff0000;
border-right: 2px solid #ff0000;
transition: .5s;
}
a:hover::before,a:hover::after{
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<a href="#">button</a>
<a href="#">button</a>
<a href="#">button</a>
</body>
</html>