PDA

View Full Version : What are divs?


JlynnMc10
02-10-2003, 03:01 PM
What are divs and how do they work?

justame
02-10-2003, 03:12 PM
jly...
in the words just a found® by searching on good ol' google.com
for... <div> description...
thisss just a seems® to explain it...:O)))

<DIV></DIV>
Contains a logical division of a page

This element is a general container for a part of the contents of a page. Through the DIV element you can add attributes, like style information, to this whole division. The DIV element will not show anything when used without any other attribute.
A division will terminate a paragraph opened with the P element.

<DIV align="center"> is the same as the deprecated <CENTER> element.

The difference between this element and the SPAN element is that the span element works inline, and the div element creates block-level content. With block-level content, most browsers surround the block by whitespace, starting at a new line.

The DIV element is a generic, catch-all Block Formatting element with an implied line break before and after. Within the realm of Style Sheets, this element is nestable to allow hierarchies of sections, subsections or chapters to be defined. This nesting ability also allows for powerful Style Sheet [-->Index DOT Css] mechanisms to be applied.

JlynnMc10
02-10-2003, 03:21 PM
Is a div like an organizational tool that makes it easier to assign some characterisitc to a group of elements?

meow
02-10-2003, 03:25 PM
:thumbsup: Wow, that's a great definition. Short and sweet.
May I use it? :D

JlynnMc10
02-10-2003, 03:26 PM
<div id="Menu0" style="DISPLAY:none">
<%=strMenuData%>

Where strMenuData is a string of data gathered from the database, and this html page includes <script src="css/Menus.js">

JlynnMc10
02-10-2003, 03:27 PM
Yes, you can you use that definition. I am glad to see I understand that much. :)

beetle
02-10-2003, 03:53 PM
Ya, a DIV is just a customizable block of HTML with no inherent properties of it's own. SPAN would be the line-level equivalent.

display: none; is the style rule for not rendering that element to the page...makes it completely hidden

JlynnMc10
02-10-2003, 06:17 PM
What is SPAN?
And what is line-level?

beetle
02-10-2003, 06:27 PM
Well, HTML elements are either line-level or block-level, commonly called line or block. Block-level elements are just that, they create a "block" contained HTML and text. Similarly, line-level tags create a "line" of contained HTML and text. Now, most tags modify the containing text or HTML in some way in addition to their line or block-level nature. Paragraph tags <p> are block-level and add an extra space beneath them. Bold tags <b> are line-level and bold the text. Only <div> and <span> are the only block and line-level tags that have no inherit properties or modifications, they exist solely to be customized.

Other (but not all) block-level tags
<blockquote>
<ul>
<ol>

Other (but not all) line-level tags
<strong>
<acronym>
<i>
<font>

winwintoo
02-10-2003, 09:03 PM
I've figured out what "divs" are and made a beautiful page with them, but when someone views the page using AOL or v4 browser the divs are not there and everything is jammed together or over top of each other.

My question is, what version of browser was divs introduced??

I'm new here, please be gentle :D

Margaret

beetle
02-10-2003, 09:13 PM
The DIV element is part of HTML 3.2, which became an official recommendation on Jan 14th, 1997.

It's been around a while. Version 4+ browsers for sure.

winwintoo
02-10-2003, 11:31 PM
Well, my page which uses divs won't display properly in Netscape 4.7 on my iMac but displays beautifully on all the latest browsers (IE, NS, Safari)

Is there some magic to making divs work on earlier browsers??

If I were to use CSS without divs, how would I get a navigation bar down the left side (about 2 inches wide) and text on the rest of the page??

Thanks, Margaret

brothercake
02-11-2003, 09:55 AM
I promise you - your problem is nothing to do with the use of divs. If you're having a problem with something, please start another thread with details.