These two elements, in combination with style sheets, are used to define the main layout of the content.

A <div> is a block level element, meaning it starts with a new line and usually groups larger structures together.

A <span> is an inline level element and it starts on the text level. It generally may contain only data such as text but not other block level elements.

Syntax:

<div></div>, <span></span>

Attributes:

Example

HTML grouping elements:

 

›› go to examples ››