Curriculum
Course: HTML and CSS 101
Login

Curriculum

HTML and CSS 101

Video lesson

Using Div and Span in HTML

This lesson will help you understand the use of two important tags Div and Span in Web page.

 

Quick Hands-on

 

Lecture Slides

 

Points to Remember

HTML <div> tag:

  • Used to define a division or a section in Web page.

  • Used as a container for HTML elements which can be styled with CSS or manipulated with JavaScript.

  • It can be styled with CSS or manipulated with JavaScript.

  • The <div> element takes the whole width of the document.

HTML <span> tag:

  • Used as an inline container to format or phrase part of a text, or a part of a document.

  • It can be styled with CSS or manipulated with JavaScript.

  • Similar to the <div> element, but <div> is a block-level element and <span> is an inline element.

  • The <span> element width is equal to the content inside it.