My Hindi Forum

Go Back   My Hindi Forum > Miscellaneous > Tech Talks
Home Rules Facebook Register FAQ Community

Reply
 
Thread Tools Display Modes
Old 14-02-2010, 06:50 PM   #1
bloglover
Member
 
bloglover's Avatar
 
Join Date: Dec 2009
Location: Boston
Posts: 18
Rep Power: 0
bloglover is on a distinguished road
Wink What is the difference between DIV and SPAN tags in HTML?

DIV is used to select a block of text so that one can apply styles to it. SPAN is used to select inline text and let users to apply styles to it.

The main difference between DIV and SPAN is SPAN does not do formatting by itself. Also the DIV tag is used as a paragraph break as it creates a logical division of the document in which it is applied. This is in contrast to the SPAN as SPAN simply dos the functionality of applying the style and alignment whatever was specified in it. DIV has ALIGN attribute in it which is not present in case of SPAN. Thus DIV is used in cases where one wants to apply styles to a block of text.

But there may be situations in which there might not be clear well structured block of text to work with. In those cases one can opt to apply SPAN which is used to apply styles inline. That is in other words DIV is generally used for block of text and SPAN is generally used for words or sentences.
bloglover is offline   Reply With Quote
Old 06-03-2010, 06:59 AM   #2
ajaypathak
Member
 
ajaypathak's Avatar
 
Join Date: Jan 2010
Location: Indore, India
Posts: 70
Rep Power: 15
ajaypathak is on a distinguished road
Send a message via MSN to ajaypathak Send a message via Yahoo to ajaypathak
Default

Span can be used in place of Font Tag.
ajaypathak is offline   Reply With Quote
Reply

Bookmarks

Tags
div and span


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT +5. The time now is 01:58 PM.


Powered by: vBulletin
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
MyHindiForum.com is not responsible for the views and opinion of the posters. The posters and only posters shall be liable for any copyright infringement.