What is the difference between Div and span tag?
Tell me the difference between Div and span tag?
In general, both are used to mark blocks of text. The span tag is used to mark text that is inline. The div is used to mark blocks of text.
<p>Blah, blah blah blah <span id="text_to_block">more blah</span> blah blah blah.</p>
div is a block element and the following can be noticed in it: The blocks are located vertically one under another, the height of a block element is determined automatically by a browser taking into consideration the content; the text is aligned to left border.
span is an inline element having the next features: A span gives a possibility to add a hook to a part of a text or a part of a document. The block elements can not be placed in inline ones.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread