[b][url]http://stackoverflow.com/questions/1142104/is-div-different-from-span-style-displayblock[/url][/b]
[quote="Greg"]Yes they are different.
Even though you style a span with display: block you still can't put block-level elements inside it:
<div><p>correct</p></div>
<span style="display: block;"><p>wrong</p></span>
The (X)HTML still has to obey the (X)HTML DTD (whichever one you use), no matter how the CSS alters things.[/quote]
然后:
[b][url]http://www.w3schools.com/tags/tag_div.asp[/url]
[url]http://www.w3schools.com/tags/tag_span.asp[/url][/b]
[quote="Greg"]Yes they are different.
Even though you style a span with display: block you still can't put block-level elements inside it:
<div><p>correct</p></div>
<span style="display: block;"><p>wrong</p></span>
The (X)HTML still has to obey the (X)HTML DTD (whichever one you use), no matter how the CSS alters things.[/quote]
然后:
[b][url]http://www.w3schools.com/tags/tag_div.asp[/url]
[url]http://www.w3schools.com/tags/tag_span.asp[/url][/b]