Wednesday, August 28, 2013

Difference between div and span in HTML tags



There are some similarity  between div and span. Both of them can be used to mark an element using id and class. But there are also some difference,  <div> is a block element, <span> is inline element..
We can put <span> inside <div>, but can not put <div> inside <span>
<div><span></span></div> OK;
<span><div></div></span> illegal.

No comments:

Post a Comment