Explain the difference between div and span

<div>

  • The <div> tag is a block level element.
  • It is best to attach it to a section of a web page.
  • It accepts align attribute.
  • This tag should be used to wrap a section, for highlighting that section.


<span>

  • The <span> tag is an inline element.
  • It is best to attach a CSS to a small section of a line in a web page.
  • It does not accept align attribute.
  • This tag should be used to wrap any specific word that you want to highlight in your webpage.