5
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by MidiMagic
0

in html elements are either block or inline types. block types causes line breaks and inline types can be added next to each other like text. so div is a block element when you insert to divs they are located on below the other, however, two spans are located next to each other.

0

I always teach it like this:

DIV = General purpose block element
SPAN = General purpose inline element

Style them with CSS for millions of different effects.

Airshow

0

I think Now you will clear te difference between the span and div
See below example

For example, this...

<ul class="menu">
  <li>Main page</li>
  <li>Contents</li>
  <li>Help</li>
</ul>

...is usually preferable to this:

<div class="menu">
  <span>Main page</span>
  <span>Contents</span>
  <span>Help</span>
</div>
0

The div tag is a generic box container.

The span tag is a generic device for adding styles (such as fonts) to text.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.