<!doctype html>
<html>
<head>
<meta charset='utf-8'>
<meta name='keywords' content=','>
<meta name='description' content=''>
<title>HTML模板</title>
<style>
*{
margin:0;
}
html{
height:100%;
}
body{
display:flex; /*弹性盒模型和margin:auto居中*/
height:100%;
background:#369;
animation:change 6s linear infinite;
}
#content{
margin:auto; /*可以和弹性盒模型一起居中*/
width:300px;
height:300px;
}
#content .love{
position:relative;
width:200px;
height:180px;
}
.love::before,
.love::after{
display:block; /*展示为块级元素*/
content:'';
width:100px;
height:150px;
background-color:black;
border-radius:100px 100px 0 0;
}
.love::before{
/*css 形变 旋转*/
transform:rotate(-50deg) translateY(27px) translateX(11px);
}
.love::after{
/*css 形变 旋转*/
transform:rotate(50deg) translateY(-149px) translateX(-59px);
}
.love:nth-of-type(2){
top:-178px;
left:92px;
}
.love:nth-of-type(2):before,.love:nth-of-type(2):after{
background-color:red;
}
/*选中其中一个*/
.love:nth-of-type(1){
z-index:999;
left:300px;
/* 匀速 无限运动*/
animation:move 6s linear infinite;
}
@keyframes move{
0%{left:300px}
50%{left:50px}
100%{left:-100px}
}
@keyframes change{
0%{background-color:#368;}
50%{background-color:#000;}
100%{background-color:#368;}
}
</style>
</head>
<body>
<!--
要避免空标签
为什么呢?
若是需要流量(人流量),则需要标签的权重
为什么不能空标签呢,爬虫在爬取的时候,会从最外面的标签开始爬取,若这个里面是无意义的标签,
则浪费了爬虫爬取的权重,爬虫根据所有的标签得到权重,若有空标签,则降低一些,则排名就降低一些
-->
<div id='content'>
<div class='love'></div>
<div class='love'></div>
</div>
</body>
</html>
<!--
伪元素: hover link active
-->
爱心日蚀
最新推荐文章于 2025-03-16 15:09:47 发布