<div> Tag Info - some useful info on using the <div> tag

free web hosting
Open Discussion > CONTRIBUTE > Tutorials

<div> Tag Info - some useful info on using the <div> tag

Saint_Michael
from my understanding of how the <div> tag works its always a good idea to use tables to get an idea where you want to you text to be position at. Also it is possibl to use negetive numbers to help position your table but that is use most of the time with the ABSOLUTE POSITION


-div style=left, right, center: basically this tells you where you info will be positioned on your website

-width: this tells how wide you can make your table so to speak where text wrapping begins

-height: this tells you how long the vertical postion will be and how far down you can go on your website with infomation

-absolute: top, bottom, : this tells you where you would like to position your area of infomation on your website it is

CODE

<div style="left: 0px; width: 0px; position: absolute; top: 0px; height: 0px">
<div style="right: 0px; width: 0px; position: absolute; top: 0px; height: 0px">
<div style="center: 0px; width: 0 px; position: absolute; top: 0 px; height: 0px">


when using mutiple div tags you want to close it each time EXAMPLE:
CODE

<div style="left: 0px; width: 0px; position: absolute; top: 0px; height: 0px"></div>
<div style="right: 0px; width: 0px; position: absolute; top: 0px; height: 0px"></div>
<div style="center: 0px; width: 0 px; position: absolute; top: 0 px; height: 0px"></div>


and then when you want to completly close it just put a </div> at the end of the document like this

CODE

</div>
</body
</html>


if i missed anything left me know

 

 

 


Reply

nickmealey
Looks good biggrin.gif . The div tag can be used for most anything, the span tag acts alot like it.

Reply

solankyno1
QUOTE(nickmealey @ Apr 7 2005, 12:28 AM)
Looks good  biggrin.gif . The div tag can be used for most anything, the span tag acts alot like it.
*



Can you please tell what is the difference between div and span tag. Although I have used them both but I could not find a clear difference between them.

Reply

googlue
QUOTE(solankyno1 @ Apr 7 2005, 12:26 PM)
Can you please tell what is the difference between div and span tag. Although I have used them both but I could not find a clear difference between them.
*



The <span> tag is very similar to the <div> tag, and the major difference between the <span> and <div> tags is that <span> will not do any formatting of it's own.

The <div> tag acts as a paragraph break, because it is defining a logical division in the document. It is comparable to the <p>tag, but advanced in that css style can also be applied individually to each <div> tag. Browsers usually place a line break before and after the <div> element.

The <span> tag simply tells the browser to apply style and align to contents between <span></span>.

Attributes:
CODE

[B]<div>Standard attributes[/B]
id, class, title, style, dir, lang, xml:lang (align attribute has become obsolete now)

[B]<div>Event attributes[/B]
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

[B]<span>Standard attributes[/B]
id, class, title, style, align, dir, lang, xml:lang


Look at this code:
CODE

<DIV id="member-data" class="member">
<P><SPAN class="member-title">Member information:</SPAN>
<TABLE class="member-data">
<TR><TH>Last name:<TD>Glue</TR>
<TR><TH>First name:<TD>Goo</TR>
<TR><TH>Tel:<TD>(000) 111-2222</TR>
<TR><TH>Email:<TD>googlue@gmail.org</TR>
</TABLE>
</DIV>

<DIV id="member-data" class="member">
<P><SPAN class="member-title">Member information:</SPAN>
<TABLE class="member-data">
<TR><TH>Last name:<TD>Lanky</TR>
<TR><TH>First name:<TD>So</TR>
<TR><TH>Tel:<TD>(000) 111-3333</TR>
<TR><TH>Email:<TD>solanky@gmail.org</TR>
</TABLE>
</DIV>


This is all I know about <div> and <span>. I also use <table> tag frequently, and am more comfortable doing so than using <div> and <span> tags.

But <div> and <span> are what's hot now!

Good luck!
Googlue

 

 

 


Reply

solankyno1
Thanks googlue for your kind reply. Now the difference between div and span tag is more clear for me. I will try to further explore this difference when I will use them in my code.
Thanks.

Reply

Saint_Michael
yeah i should have formatted it with tables hmm and i completly forgot about the span well never really used it myself biggrin.gif

Reply

shotgun_sonata
the <span> tag is an inline element and is meant to be used to format text without tags like <font><b><i>, etc... in the newest versions of html, these tags are depreciated. and <span> can be used to define all of them.

the <div> tag is meant more as an item rather than just text formating.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.


*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for tag, info, info, tag

*MORE FROM TRAP17.COM*
advertisement



<div> Tag Info - some useful info on using the <div> tag



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE