Jump to content

why we use div function.


lovelyjitu

Recommended Posts

thats not php - its (x)html.

 

a div difines a divide - this allows you to group contentent on the page.

 

ie <div id="navigation"> could contain all your html for your navigation..

 

the beauty of it all is that if you have your content grouped like this you can place it anywhere you want on teh page with css.

I think a clearer explanation of what toon is trying to say is that by useing the <DIV> tags you can call your CSS for that division. Makes it easier when updating sites etc.

EXAPMLE:

html: <div id=output> Some output </div>

CSS: #output {

          width: 350px;

          color: red;

          font-style: Juice ITC;

        }

 

This calls the CSS for the div with the ID "output" then you set all your perameters for the div in css. see easy. (you can also call css styles inside the div tag with "<div style="width: 350px;>"" etc. hope I helped.

<div> tag to group block-elements to format them with styles.

 

This is some text <div style="color:#FF0000;">

<h4>This is a header in a div section</h4>

<p>This is a paragraph in a div section</p>

</div>

 

output

This is some text

This is a header in a div section

 

This is a paragraph in a div section

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.