tag but many of you guys never have a usuful look on it. As i know div tag is the backbone of a consistent css used website.
Basically div is a section you can say which separate the sections in a webpage. But div not only separate the contents but it also provides the different formating for each section.
Div and Web Design.
If you develop web
applications then surely you know about the Div
tag but many of you
guys never have a usuful look on it. As i know div
tag is the backbone of a consistent css used website.
Basically div is a section
you can say which separate the sections in a webpage. But div not only separate
the contents but it also provides the different formating for each section.
If you are using Cascading
Style Sheet for formating your website then you can use these css by including
its id in div tag. Every div tag contains a unique attribute name for id. Div
make the webpage design sections like if you are using css for creating a side
menu list then you can define a div as the setting its properties to left or
right, that means by using div tag you can group the large html contents.
side: I like the div tag because it separte my web page contents which are
handy to format and looks always cool.
Now we will talk about the attributes of div tag
As we discussed in the intro,
that div tag contains an id
ID: ID attribute always contains a unique
name as the name suggests id.Eg:
Here you can see that we used properties like aligh and
bgcolor so here we have formated this div tag means a separate section not the
ID For CSS:
are creating a CSS like then you can use ID attribute for div tag. Like if you
require to create many headings for your webpage with different styles then, a
single style will not enough.
font-family:Comic Sans MS;
Now you can use these in your aspx page. Like.
This is heading one.
This is heading two.
As we have used this property in
our previous example.
But even take an example of google.com notice that there are
some links on the right top when you resize the page they even appear in that
Different alignments are:
<div id="menu" align="right" >
<a href="login.aspx">Logina> |
the red box there are two links which we have created before when you resize
your window as it is already these links will also resize to be visible in the
As the name suggests style tag is used to format the div tag.
Like setting it's background color, font etc.
style="border: 3px inset Red; background-color:Silver; ">
<p>This is a
formated div tag by using its style attribute.
you can define anything here like controls or which you want
in your webpage.p>
Here the part of code which you have to notice is underlined.
First we use style then its properties like background-color:silver
When you type a keyword then AI will open to help you
the text direction for the content in an element.
rtl: for right side.
ltr : for left side.
This is a example of dir attribute of div.
Try this line of code, and this line will appear in the right
side of the web page.
Title tag is used to give the more information
to the div tag
In the browser,
you can say it a tooltip for another controls.
<div dir="rtl" title="this is right