![]() |
|
|||||||
|
|
|
|
|
|
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 ...
|
![]() |
|
|
Thread Tools |
|
#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
|
||||||||||||
|
||||||||||||
|
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: 日夏子
|
|
#3
|
||||||||||||
|
||||||||||||
|
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
|
|
#4
|
|||
|
|||
|
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
|
|||
|
|||
|
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. |
![]() |
|
| Bookmarks |
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 | |
|
|