Travel Fans
Go Back   Computer Juice Computer Software Web Design, Hosting & SEO

Register

 Default 

HTML Webdesign <div> tag?




Reply
 
Thread Tools
  #1  
Old 21st Nov 2008, 05:30
New Member
Posts: 1
 
I learned HTML about 4-5 years ago and I've pretty much mastered the use of tables to format my websites. However, when i look at the source for page sites now a days they are full of this tag. What is it? Do i need to use the tag? Is there anything wrong with just using tables?

  #2  
Old 21st Nov 2008, 06:12
Donor VIP
Posts: 3,922
 
Tables should only be used for tabular content, not formatting. Div is the proper way both to format content and apply stylesheets to that content.
__________________
"I loved the P182 so much that, when my wife's system was all noisy and needed all sorts of cleaning, I bought her one. Then, when I wanted a cat, I bought a P182. The P182 is not a cat per se, but it's still an excellent buy."
__________________

My System: 日夏子

Processor(s):
C2D E6400 2.13 -> 3.00 OC
Motherboard:
MSI P6N SLI Platinum 775
RAM Memory:
2GB Patriot DDR2-800
Graphics Card(s):
PNY 8800GTS 320MB
Sound Card:
Sound Blaster Xtremegamer
Hard Drive(s):
1TB F3 + 500GB + 80GB
Optical Drive(s):
1x SATA
Case / PSU:
Antec 900 / Corsair 750HX
Cooling:
3 Yate-Loon 120mm + 200mm
Network / Internet:
Qwest
Monitor(s):
Dell 22" S2209W 1920x1080
Operating System(s):
Windows XP + 7
  #3  
Old 21st Nov 2008, 07:57
MJM
Donor VIP
Posts: 408
 
You need to learn to seperate contents from style.
What surprises me is that you were using tables 4-5 years ago... that's when CSS really started picking up.
__________________

My System: Toshiba Satellite A200-28P

Processor(s):
Intel Core 2 Duo T8100
Motherboard:
Mobile Intel PM965 Express Chipset
RAM Memory:
1024 + 2048MB DDR2 667
Graphics Card(s):
ATI HD 2600 XT
Sound Card:
Toshiba Bass Enhanced Sound System
Hard Drive(s):
200GB 5400RPM
Optical Drive(s):
DVD Super Multi
Case / PSU:
Satellite A200 Series
Cooling:
Stock
Network / Internet:
Intel 4965AGN
Monitor(s):
15.4" 1,280x800 Toshiba TruBrite
Operating System(s):
Windows Vista SP1 / Fedora i386
  #4  
Old 24th Nov 2008, 03:50
Full Member
Posts: 79
 
CSS has been around for about 12 years now, and has been the main way to style web sites for the last five or six years. Tables are NOT for page layout, they are for tables of data.

A div is what is called a generic container. You put the page contents into divs, and position the divs relative to each other, usually by floating them. Avoid using absolute positioning wherever possible, as it can result in problems on re-sizing the viewport. It is also normal to put some divs inside another div. I think you have a lot of catching up to do - visit sitepoint and get some of their introductory books on using css for layout. I'd suggest "Build your own website the right way using html and css" , "HTML upotia, designing without tables" and "The CSS Anthology" . Get the latest editons in each case. I'd ignore their most recent book "Everything you know abot css is wrong" as it seems to cover css3, which is still in development, and most of the stuff is not supported in current browsers (whatever the browser manufacturers and fanatical advocates tell you!)

But, if you can only afford one book then get CSS Mastery Advanced Web Standards Solutions by Andy Budd. In fact, get this book along with any one of the sitepoint books.

If you wish to learn more about css, try www.cssbasics.com and www.htmldog.com

CSS had problems when it first appeared, as the browsers all supported differnet amounts of it and some did things their own way, but the situation has improved greatly in the last few years, and there are lots of sites which provide tried and tested css based layouts - google is your friend.
  #5  
Old 5th Jan 2009, 07:17
Full Member
Posts: 19
 
A div is like shrink-wrapping something - on its own, it has no set dimensions at all - it expands or shrinks in relation to its content.

If you want to get all clever and set properties for the div (and there are PLENTY or properties you can give it), you need to give it an id or a style (for example <div id="header">), then define these using css (usually linked in your header tag as a separate file):

#header { width:100%; height: 50px; color: blue; }

It's remarkably simple and you can teach yourself by having a look at other sites' code.
Reply

Register

Similar Threads
Thread Thread Starter Forum Replies Last Post
I need a name for my webdesign company ? peterporzsolt Web Design, Hosting & SEO 7 2nd Mar 2009 08:06
Question about html oobrokensilence Web Design, Hosting & SEO 5 20th Jun 2008 13:58
Quick html question... kpbotbot Web Design, Hosting & SEO 1 17th Jun 2008 04:04
HTML Editors megabyte Web Design, Hosting & SEO 11 21st Apr 2008 15:01
Html help with form. oobrokensilence Web Design, Hosting & SEO 5 19th Feb 2008 16:12
Thread Tools



Translations Powered by Powered by Google
Arabic Bulgarian Chinese Croatian Czech Danish Dutch English Finnish French German Greek Hebrew Hungarian Italian Japanese Korean Latvian Lithuanian Norwegian Polish Portuguese Romanian Russian Serbian Slovak Spanish Swedish Taiwanese Thai Turkish Ukrainian

Copyright 2006 - 2010 Computer Juice.

Powered by vBulletin® Copyright ©2000 - 2010 Jelsoft Enterprises Ltd. SEO by vBSEO ©2009, Crawlability, Inc.