一、边框的常见设置方式:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>盒子模型之边框</title>
<style type="text/css">
div {
width: 200px;
height: 200px;
border-top: 1px solid red;
border-bottom: 10px solid blue;
border-left: 3px dashed green;
border-right: 5px dashed pink;
}
</style>
</head>
<body>
<div></div>
</body>
</html>
二、内边距
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>内边距</title>
<style type="text/css">
div {
width: 200px;
height: 300px;
border: 1px solid red;
padding: 5px;
}
a {
height: 35px;
background-color: #ccc;
display: inline-block;
line-height: 35px;
text-decoration: none;
padding: 5px;
}
</style>
</head>
<body>
<div>文本信息</div>
<a href="#">首页</a>
<a href="#">移动客户端</a>
</body>
</html>