常见的行内元素和块状元素
行内元素
<span>、<a>、<br>、<b>、<strong>、<img>、<input>、<textarea>、<select>、<sup>、<sub>、<em>、<del>
块状元素
<address>、<center>、<h1>~<h6>、<hr>、<p>、<pre>、<ul>、<ol>、<dl>、<table>、<div>、<form>
行内元素和块状元素的区别
行内元素
- 设置宽高无效
- 对margin设置左右方向有效, 而上下无效, padding设置都无效
- 不会自动换行
块状元素
- 可以设置宽高
- 设置margin和padding都有效
- 可以自动换行
- 多个块状, 默认排列从上到下