div tags?

What's on your mind?

Moderator: kosh

Post Reply

div tags?

Post by Altron » Tue May 17, 2005 12:35 am

I need a bit of help learning how to do div tags on my up-and-coming website, www.in-finity.cjb.net

Any sites you could refer me to, or just gimme some raw help? I'm starting from square one. Thanks to all who give it a shot!

User avatar
Site Admin
Site Admin
Posts: 2819
Joined: Tue Feb 18, 2003 2:14 am
Location: Austin, TX

Post by Tachyon » Tue May 17, 2005 3:46 am

http://www.westciv.com/style_master/aca ... intro.html

That link may be worth a shot. I learned my CSS from 3 books:
http://www.amazon.com/exec/obidos/tg/de ... ce&s=books
http://www.amazon.com/exec/obidos/ASIN/ ... 40-2896169
http://www.amazon.com/exec/obidos/ASIN/ ... 40-2896169

Put those books together and you've got a powerful punch. However, it takes time to read through them.

To answer your question, I'll first explain 2 important types of code in HTML/CSS -- block level vs. inline. <div> is the basic, generic block level item and <span> is the basic, generic inline item.

A block level element won't share a line with other elements. It will drop down beneath the previous element and force all elements that follow to be below it. For example, the paragraph tag in HTML <p> won't sit next to another <p>. I forces the 2nd <p> to appear below it.

An inline element allows other items to sit next to it. Letters typed into an HTML document don't mind sitting next to each other.

<p>, <h1> and other tags are block level but they are intended for specific purposes. An <h1> is header text. It announced what a page, section or paragraph is about. A <p> tag is a paragraph that contains text that site visitors are supposed to read. <div> is a little different. It's generic and has no set purpose. It's a part of HTML as a sort of "Swiss army knife." It can serve any purpose.

If you don't use CSS commands to control a <div> it will behave just like a <p>. It will hold whatever you put between the <div> and the </div> and refuse to sit next to anything else. It will insert blank lines above and below it to make certain that it doesn't appear to be a part of anything else.
If you don't like the news then go make some of your own.

Post Reply