<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> /* 圆角 */ div{ width: 400px; height: 400px; background-color: blueviolet; border-radius: 20px; margin: 0 auto; /* 阴影 */ box-shadow: 0,10px,40px,rgba(10, 10, 10, 0.5); } </style></head><body> <div ></div></body></html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
/* 动画效果 */
div{
width: 200px;
height: 200px;
background-color: red;
animation: myAnim 3s linear 0s infinite;
}
div:hover{
animation-play-state: paused;
}
@keyframes myAnim{
0%{
background-color: red;
}
50%{
background-color: green;
}
100%{
background-color: red;
}
}
</style>
</head>
<body>
<div></div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
/* 呼吸灯效果 */
.box{
width: 300px;
height: 300px;
margin: 40px auto;
background-color: aquamarine;
border-radius: 5px;
box-shadow: 0 1px 2px rgba(0, 0, 0, .5);
animation: breathe 3s ease-in-out infinite alternate;
}
@keyframes breathe {
0%{
opacity: 0.2;
box-shadow: 0 1px 2px rgba(rgb(83, 58, 58), green, blue, 0.1) ;
}
50%{
opacity: 0.5;
box-shadow: 0 1px 2px rgba(rgb(104, 151, 145), green, blue, 0.76);
}
100%{
opacity: 1;
box-shadow: 0 1px 2px rgba(rgb(158, 203, 46), green, blue, 1);
}
}
</style>
</head>
<body>
<div class="box"></div>
</body>
</html>