span 和 div 的区别
Definition and Usage
- The
<span>
tag is an inline container used to mark up a part of a text, or a part of a document.- The
<span>
tag is easily styled by CSS or manipulated with JavaScript using the class or id attribute.- The
<span>
tag is much like the<div>
(www.w3schools.com/tags/tag_di…) element, but<div>
is a block-level element and<span>
is an inline element.
<span>
设置宽高无效, <div>
设置高度有效