Pr.Pg Next Pg

<DIV> tag tutorials

<DIV> tag indicates logical divisions within a document.

Web developers use <div> elements to group together HTML elements and apply CSS styles to many elements at once.

For instance, by wrapping a set of paragraph elements into a <div> element, the developer can take advantage of CSS styles and apply a font to all paragraphs at once, by applying a font style to the <div> tag instead of coding the same style for each paragraph element.

<DIV> tag has following attributes:

 

Sr No

Attributes

Descriptions

1

ID

This attribute define the unique ID for each <DIV> tag.

2

ALLIGN

This attributes defines the position left/right/center/justify.

3

TITLE

This attributes specifies the text to the div

4

CLASS

This attributes Indicate which CSS class applied to the <DIV> element.

 

 

Syntax:

<body>

<div>…</div>

<body>

 

Example: HTML program to demonstrate DIV

Output:

Note: Now move the mouse to the over acronym

Pr.Pg border                                              Next Pg