CSS3盒子模型
<!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>CSS3盒子模型</title>
<style>
div:nth-child(1) {
width: 200px;
height: 200px;
background-color: pink;
padding: 10px;
border: 1px solid red;
}
div:nth-child(2) {
box-sizing: border-box;
width: 200px;
height: 200px;
background-color: purple;
padding: 10px;
border: 1px solid blue;
}
</style>
</head>
<body>
<div></div>
<div></div>
</body>
</html>
效果展示
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/89d3906b128c3aa77da800fe5a30b7b0.png)
移动端特殊样式
<!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>
a {
-webkit-tap-highlight-color: transparent;
}
input {
-webkit-appearance: none;
}
</style>
</head>
<body>
<a href="#">黑马</a>
<input type="button" value="按钮">
</body>
</html>