Jump to content

<span> & <p>


hacker

Recommended Posts

will anyone tell me the difference between <span></span> & <p></p> ?what is the use of <span></span> ?
There are two types of elements in HTML block, and in-line <span> is an in-line element. There is spacing no around this element. Span is closest compared to <div> rather them <p> "p and div" are both block elements.
Link to comment
Share on other sites

There are two types of elements in HTML block, and in-line <span> is an in-line element. There is spacing no around this element. Span is closest compared to <div> rather them <p> "p and div" are both block elements.
um, you are right that <span> is an inline element, but you are wrong in comparing <span> to a <div>. <div> and <p> both behave the same because they are block level elements. <span> would better be associated with <a> since they are both inline elements by default.
Link to comment
Share on other sites

It might be better to say that a span is the inline counterpart of a div. There are two reasons for this.1. Both are semantically neutral. They function as containers only without suggesting anything about their content.2. Apart from their default display rules, they are devoid of any style. This makes them useful as basic containers.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...