Now, seriously, I really would love to know what in God's name this tag accomplishes. I see it in almost every source code, but I have no clue what it actually does. Can somebody clue me in?
Now, seriously, I really would love to know what in God's name this tag accomplishes. I see it in almost every source code, but I have no clue what it actually does. Can somebody clue me in?
The div element is a generic block-level element. It's main use is to group elements together (headers [but not headings], footers, etc.), particularly to allow that group to manipulated as one in a style sheet. It can also be used if there are no appropriate, semantic block-level elements that can be used to mark up part of a document. The span element is similar, though it is an in-line element.
For example, to mark up an address[1], one might write:
To mark up the name of a species,HTML Code:<div class="address"> ... </div>
would be appropriate, though so would use of the i element (maintaining the italic presentation might be more important than avoiding presentational markup in the event of no CSS).HTML Code:<span class="species">H. s. sapiens</span>
Mike
[1] There is an address element, but that is for information about the author of the document, not addresses in general.
gouping works i guess, but the tag won't do anything usefull unless you define the parameters, for example piczo, uses div tags to group chunks of html together, each image is placed in a div tag, as well as the friends and page lists, allowing you to drag everything around and not worry about p and br tags, you can also use div tags to create moveable elements merzo.net (lame webpage but perfect example of moveable divs
DIV like others said, groups certain parts of the code. If you have a stylesheet, then you can apply certain styles to only the parts with that name. It also helps for javascript and other things
Bookmarks