SQL PHP HTML ASP JavaScript articles and free scripts to download
 

Integrating id align class to Div Tag

We can divide different areas of web page using div tags. This is a powerful tool and for different applications which we will discuss later. Here we will try to understand the basics of div tag.

Using div tag we can control a particular area or a block of code and text within it. Div tag ads one line break before it staring and after it ending tag. Here is a simple structure of div tag.

<div id="my_area">
My text here
</div>

You can see we have defined the are within the div tag with id=my_area , this is useful for us to further manage the area using DHTML. We will learn them in our next tutorial. Now we will learn different attributes with examples.

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. Here is one example of align attribute

<div id="my_area" align="right">
My text here
</div>
My text here
<div id="my_area" align="center">
My text here
</div>
My text here
<div id="my_area" align="left">
My text here
</div>
My text here
We 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

<div id="my_area" class="data">
This is a right aligned text2
</div>

Now 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

<div id="my_area" class="data" title="This is a test for title on Div tag">
This is a right aligned text2
</div>


To see the example place your mouse over this line

This is the basic of div tag, we will try to learn more on application of div tag in DHTML by placing mouse over it.

How to position a div tag


Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked


Join Our Email List
Email:  
For Email Newsletters you can trust
List of HTML Tutorial
HTML Tags
HTML Calendar
Tags on web page
Web Design