一、水平居中
text-align: center; /* 让盒子中的文字居中对齐 */
margin: 0 auto; /* 让盒子居中 上下为0 左右为auto */
二、圆角边框
<style type="text/css">
div {
width: 300px;
height: 300px;
background-color: pink;
margin: 100px auto;
border-radius: 50%;
}
</style>
三、盒子阴影效果
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
body {
color: #fff;
}
div {
width: 200px;
height: 200px;
background-color: #ccc;
transition: all 1s;
}
div:hover{
box-shadow: 0px 15px 30px rgba(0,0,0,0.1);
}
</style>
</head>
<body>
<div></div>
</body>
</html>