1.html标签类型能够分为三大类:
- 块级标签(block):特色是独占一行,能随时设置width与height,好比div,p,h1,h2,ul,li.
- 行内标签(inline):特色是多个行内标签能同时显示在同一行,宽度与高度取决于内容的尺寸,好比span,a,label。
- 行内块级标签(inline-block):特色:多个行内-块级标签能够显示在同一行,能同时设置宽度与高度,好比button与input。
2.css中有个display属性,能修改标签的显示类型。
- none:隐藏标签。
- block:让标签变为块级标签,
- inline:让标签变为行内标签。
- inline-block:标签变为行内-块级标签,
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">css的可继承属性
<title>css的可继承属性</title>
<style>
body{
font-size: 30px;
color: yellow;
}
div {
background-color: red;
width: 150px;
height:160px;
}
span {
background-color: blue;
display: block;
width: 100px;
height: 100px;
}
</style>
</head>
<body>
<div>我是块级标签</div>
<span>我是行内标签</span>
<!--<button>我是行内块级标签</button>-->
</body>
</html>