Web Hosting Talk







View Full Version : <div> tag tutorials?


MattSharp
03-13-2003, 06:39 PM
I need to work on my skills with the <div> tag. Are there any good tutorials out there that anyone knows of? Even if they are basic? I tried webmonkey but no luck there.

harmonic
03-13-2003, 07:09 PM
Don't use <div>, use <span>, and go to www.w3schools.com

mmoncur
03-13-2003, 08:31 PM
Nothing wrong with <div>. Depends on what you need it for.

Rich2k
03-14-2003, 05:35 AM
Div is fine, especially if you are using them for layout (instead of layout tables).

In fact div is fine to replace tags such as <table> <p> <hn> as it is designed for divisions of text.

Acronym BOY
03-14-2003, 08:20 AM
Originally posted by harmonic
Don't use <div>, use <span>, and go to www.w3schools.com

You must be joking, right?

harmonic
03-14-2003, 06:38 PM
Most of the time its better to use span, div divides the text up, but sometimes people use it in the wrong places.

If you know where to use div, then by all means do. But i was just making the assumption he wanted to learn inline css which <span> was designed for.

Span is for css, which is what i think he wanted..

Rich2k
03-15-2003, 06:57 AM
Originally posted by harmonic
Span is for css, which is what i think he wanted..

Once again, you are joking right?

Yes span is for inline formatting and div for divisions. However CSS is not just an inline thing, it's a formatting thing which can be applied to any element on the page.

<div> to control layout is governed by CSS!

In fact there are many people who now don't design layout tables but design layout <div> (which I still don't do enough, generally because it's quicker to generate the table)

harmonic
03-15-2003, 04:11 PM
div is block level, a lot of people don't realize that; that's all im trying to say.

Acronym BOY
03-15-2003, 06:31 PM
Originally posted by harmonic
div is block level, a lot of people don't realize that; that's all im trying to say.

Unless you want all of your content in one block that is laid out in a viusally appealing manner, than you need div's. The poster recognized that and asked if he coudl get some help.

Than you come along and decide to tell him not to use div's. You need div's.

To answer the original question, which has a lot to do with the box model in many ways, head here:

http://www.thenoodleincident.com/tutorials/box_lesson/boxes.html
http://glish.com/css/

For rudimentary box model info head here:

http://www.brainjar.com/css/positioning/

You can also google for guys like Eric Meyer (who literally wrote the book on CSS) among other places to help you out.

Reptilian Feline
03-17-2003, 07:14 AM
Don't forget the great place for standards called www.w3.org/TR/

Specifically <div> in HTML: http://www.w3.org/TR/html401/struct/global.html#h-7.5.4
and css: http://www.w3.org/TR/REC-CSS2/