代码
<!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>圆角边框</title>
<style>
div {
width: 200px;
height: 200px;
background-color: red;
border-radius: 10px;
}
</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>
.yuanxing {
width: 200px;
height: 200px;
background-color: pink;
border-radius: 100px;
/* 50% 就是宽度和高度的一半,等价于100px */
border-radius: 50%;
}
.juxing {
width: 300px;
height: 100px;
background-color: red;
/* 圆角矩形设置为高度的一半 */
border-radius: 50px;
}
.renyi {
width: 200px;
height: 200px;
background-color: green;
border-radius: 10px 30px 40px 60px;
}
</style>
</head>
<body>
1圆形
<div class="yuanxing"></div>
2圆角矩形
<div class="juxing"></div>
3任意
<div class="renyi"></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: pink;
margin: 100px auto;
}
/* 原来盒子没有阴影,当鼠标经过时才有阴影 */
div:hover {
box-shadow: 10px 10px 10px 10px rgba(0, 0, 0, 0.3);
}
</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 {
font-size: 100px;
color: orange;
font-weight: 700;
/* text-shadow: 5px 5px 6px rgba(0, 0, 0, 0.3); */
}
div:hover {
text-shadow: 5px 5px 6px rgba(0, 0, 0, 0.3);
}
</style>
</head>
<body>
<div>那是阴影,我是火影</div>
</body>
</html>