PDA

View Full Version : Web building help CSS and Html?


eddiesoddsandends
01-25-2009, 02:59 AM
Ok, I know how to use tables and how to edit them and what not but how and why do i see on some webpages? Is there a difference in using either? Also, if div is something else please explain what the tag does and how to use it. TIA

what?!?
01-25-2009, 04:00 AM
The tag defines a division or a section in an HTML document.

The tag is often used to group block-elements to format them with styles.

If you take actual Web Programming course, they will teach you to use div tag instead of tables. Personally they both do their job perfectly fine, div tag is a bit harder to get things position correctly on your screen than table does. Table is more so a beginner style. In the long run div tags will be more flexible and powerful to use.

Example:
This is a headerThis is a paragraph.This is a headerThis is a paragraph.

*h3 and p tag within the div tag will be display in green color vs the same ones outside of the div tag

webdesign.about.com (http://webdesign.about.com/od/htmltags/a/aa011000a.htm)

Phillip B
01-25-2009, 06:00 AM
Tables are for tabular data. Yes, a few years ago it was common to use tables for layout, because the available browsers weren't that consistent or compliant with the standards. These days, Divs work fine, and give you the opportunity via CSS to target your design to things like mobile phones as well.

Think of a Div as a box. It can then be positioned in a number of ways - absolute, fixed, floating, etc.

My personal preference is to float them, with widths constrained in ems or percentage for text or pictures respectively. Then I add a Clear to the next Heading.

Experiment!