css模型自动内减
<!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>
.one {
width: 200px;
height: 200px;
background-color: blue;
border: 10px solid pink;
padding: 50px;
}
.two {
width: 200px;
height: 200px;
box-sizing: border-box;
background-color: blue;
border: 10px solid pink;
padding: 50px;
}
</style>
</head>
<body>
<!-- 无自动内减 -->
<div class="one"></div>
<!-- 自动内减 -->
<div class="two"></div>
</body>
</html>
效果图: