<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>风车</title>
<style>
header{
/*设置背景图片*/
background-image: url(caodi.png);
/*设置宽度*/
width: 1000px;
/*设置高度*/
height: 500px;
/*设置图片的大小 contain:覆盖容器*/
background-size: contain;
/*设置图片不重复显示*/
background-repeat: no-repeat;
/*设置图片水平居中*/
margin-left: auto;
margin-right: auto;
}
section{
background-image: url(fengche.png);
background-size: cover;
background-repeat: no-repeat;
}
section:nth-child(1){
width: 350px;
height: 350px;
position: absolute;
left: 123px;
top: 50px;
animation: rotate 2s linear infinite;
}
section:nth-child(2){
width: 150px;
height: 150px;
position: absolute;
left:449px ;
top: 290px;
animation: rotate 1s linear infinite;
}
section:nth-child(3){
width: 250px;
height: 250px;
position: absolute;
left:586px ;
top: 200px;
animation: rotate 1s linear infinite;
}
/*css里面的动画属性*/
@keyframes rotate {
from{
transform: rotate(0deg);
}
to{
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<header>
<section></section>
<section></section>
<section></section>
</header>
</body>
</html>