分为块级元素、行内元素、行内块元素三种
他们之间可以使用来进行模式转换
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>标题</title>
<style>
div {
height: 100px;
width: 100px;
background-color: red;
display: inline; /*把块级元素转换为行内元素*/
}
span {
height: 150px;
width: 150px;
background-color: green;
display: block; /*把行内元素转换为块级元素*/
}
a {
height: 20px;
width: 80px;
background-color: blue;
display: inline-block; /*把行内元素转化成行内块元素*/
}
</style>
</head>
<body>
<div>123</div>
<div>123</div>
<div>123</div>
<span>abc</span>
<span>abc</span>
<span>abc</span>
<a href="#">百度</a>
<a href="#">百度</a>
<a href="#">百度</a>
</body>
</html>