contact@codebetter.in 8823075444
9993928766
  • Tutorials Home
  • Contact

What is the difference between <div> and <span> elements?

Sr.No. <div> <span>
1. The <div> tag is a block level element. The <span> tag is an inline element.
2. It is best to attach it to a section of a web page. It is best to attach a CSS to a small section of a line in a web page.
3. It accepts align attribute. It does not accept align attribute.
4. This tag should be used to wrap a section, for highlighting that section. This tag should be used to wrap any specific word that you want to highlight in your webpage.