HTML Page Structure

HTML Elements
HTML Attributes


HTML Div Tag

Whenever you want to apply some effect like change of text color on a group or over a large section of your document, you can use <div> tag. With the help of HTML div tag you can make a group of large sections of HTML elements together and apply CSS on that whole section. Developers usually use <div> element to group together large number of HTML elements and apply CSS styles to these elements in a single shot.

The main difference between the div tag and the span tag is that div is used with block-level elements whereas span is used with inline elements.

Syntax

Example

This will produce following result

Welcome!

Welcome to techstrikers!

Welcome to techstrikers!