www.webdeveloper.com
Results 1 to 3 of 3

Thread: What is the difference between Div and span tag?

  1. #1
    Join Date
    Jul 2013
    Posts
    45

    What is the difference between Div and span tag?

    Hello Friends,
    Tell me the difference between Div and span tag?

  2. #2
    Join Date
    Feb 2005
    Location
    Indianapolis, IN
    Posts
    132
    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.

    For example:
    Code:
    <div id="Paragraph">
    <p>Blah, blah blah blah <span id="text_to_block">more blah</span> blah blah blah.</p>
    </div>

  3. #3
    Join Date
    Jun 2013
    Location
    Dubai
    Posts
    73
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles