Using div tag we can control a particular area or a block of code and text within it. Here is a simple structure of div tag.
Attributes Align: Values : left, right, center, justify
We can set the align attribute to different values and manage the text within the div tag area.
classWe can integrate our existing style sheet and define a class for the div tag. Here is the code to integrate an existing class to the div tag
TitleNow let us try to add one title to this div tag. On mouse over the div area title text will be displayed like alt tag of images. Here is the code
To see the example place your mouse over this line
StyleWe can assign inline style properties to our DIV box
In addition to this there are more attributes like onClick, ondblclick, onmouseover, onmouseout, onmousmove, onkeypress, onkeydown, onkeyup.
We will try to learn more on application of div tag in DHTML by placing mouse over it.
This article is written by plus2net.com team.