Reply
Layout with DIVs
Old 04-02-2008, 07:56 PM Layout with DIVs
Novice Talker

Posts: 12
Name: Zeke
Hi guys, I am new here. I've been reading the forum for a while but this is my first post ever.

I need some help, I've been trying to figure this out for over 3 hours and IT'S DRIVING ME NUTS!

So, here's the deal: I've been designing websites for a while, but always personal ones, so I really didn't care a lot about SEO or HTML standards. The problem is that I've been working with tables for layout and it is very easy and convenient, but according to what I read here, is bad for SEO and doesn't comply with HTML standards, or is wrong for some reason.

Well, I want to do something like this with Dreamweaver CS3:



That is just an example, but the idea would be to have 3 icons on the left and their explanations (text) on the right.

When I try to do that with tables, it is very easy, here's the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="../My Documents/Marriage Green Card/website/oneColElsCtr.css" rel="stylesheet" type="text/css" />
</head>

<body class="oneColElsCtr">

<div id="container">
<div id="mainContent">
<table width="484" border="1">
<tr>
<th width="192" scope="row"><img src="http://tbn0.google.com/images?q=tbn:_iQ-nHCpYrnTqM:http://www.bursar.psu.edu/images/8863form.gif" width="106" height="137" /></th>
<td width="276">Step 1: Fill out our online form</td>
</tr>
<tr>
<th scope="row"><img src="http://tbn0.google.com/images?q=tbn:2D6dkp4AfJamOM:http://www.fire.london.ca/images/checkmark.gif" width="89" height="99" /></th>
<td>Step 2: Verify your Information</td>
</tr>
<tr>
<th scope="row"><img src="http://tbn0.google.com/images?q=tbn:Gg7x-3flVYrImM:http://www.aiga.org/Resources/SymbolSigns/gif_large/01_telephone_inv.gif" width="136" height="136" /></th>
<td>Step 3: We will call you</td>
</tr>
</table>
</div>
</div>
</body>
</html>

But the problem is when I try to use the div tags. Here's the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>divs</title>
<link href="../My Documents/Marriage Green Card/website/oneColElsCtr.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
#apDiv1 {
position:absolute;
left:164px;
top:0px;
width:0px;
height:3px;
z-index:1;
}
#apDiv2 {
position:absolute;
left:158px;
top:27px;
width:150px;
height:150px;
z-index:2;
}
#apDiv3 {
position:absolute;
left:158px;
top:177px;
width:150px;
height:150px;
z-index:2;
}
#apDiv4 {
position:absolute;
left:158px;
top:327px;
width:150px;
height:150px;
z-index:2;
}
#apDiv5 { position:absolute;
left:158px;
top:177px;
width:150px;
height:150px;
z-index:2;
}
#apDiv6 {
position:absolute;
left:308px;
top:27px;
width:500px;
height:150px;
z-index:3;
}
#apDiv7 {
position:absolute;
left:308px;
top:177px;
width:500px;
height:150px;
z-index:3;
}
#apDiv8 {
position:absolute;
left:0px;
top:150px;
width:500px;
height:150px;
z-index:3;
}
#apDiv9 { position:absolute;
left:308px;
top:177px;
width:500px;
height:150px;
z-index:3;
}
-->
</style>
</head>

<body class="oneColElsCtr">

<div id="apDiv1"></div>
<div id="apDiv2"><img src="http://tbn0.google.com/images?q=tbn:_iQ-nHCpYrnTqM:http://www.bursar.psu.edu/images/8863form.gif" alt="" width="106" height="137" /></div>
<div id="apDiv6">
<div align="left">Step 1: Fill out our online form</div>
</div>
<div id="container">
<div id="mainContent">
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="apDiv3"></div>
<p>&nbsp;</p>
<div id="apDiv5"><img src="http://tbn0.google.com/images?q=tbn:2D6dkp4AfJamOM:http://www.fire.london.ca/images/checkmark.gif" alt="" width="89" height="99" /></div>
<div id="apDiv7">
<div id="apDiv8">Step 3: We will call you</div>
Step 2: Verify your Information</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="apDiv4"><img src="http://tbn0.google.com/images?q=tbn:Gg7x-3flVYrImM:http://www.aiga.org/Resources/SymbolSigns/gif_large/01_telephone_inv.gif" alt="" width="136" height="136" /></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
</div>
</body>
</html>

By the way, both files are linked to a CSS which code is:

@charset "utf-8";
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #666666;
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
color: #000000;
}
.oneColElsCtr #container {
width: 46em;
background: #FFFFFF;
margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
border: 1px solid #000000;
text-align: left; /* this overrides the text-align: center on the body element. */
}
.oneColElsCtr #mainContent {
padding: 0 20px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
}

Here's the problem for the case where I used the AP Divs:

This is an image of how do I see it on the Dreamweaver, and I would like to see it like that on my browser too:



But this is how I actually see it on my browser:

http://img26.picoodle.com/img/img26/...2m_04175bb.jpg

------------------------------------------------------------------

Now, here is the challenge: how in the world do I use AP divs to get the same control and results that I get with tables? When I resize the browser window, the images and the text change positions.

I would like to be able to use div tags instead of tables, since divs are supposed to be way better, but it is so hard to manage them. Tables were very easy!

Please HELP!!!!

Thank you so much in advance for your help guys.
ZekeLL is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 04-02-2008, 08:59 PM Re: Layout with DIVs
wayfarer07's Avatar
$frontend->developer

Posts: 1,037
Name: Abel Mohler
Location: Asheville, North Carolina USA
I'll tell you two things to begin with: 1.You shouldn't be relying on Dreamweaver to see how your page is displaying. 2. You shouldn't be using absolute positioning to layout a grid like this. You are making things much to complicated for yourself;

That said, there are a few possible approaches that could be used to gain the desired result. Before I give any advice, I'd like to know why you are concerned with this area resizing? It looks like a very small area, and I don't see how that would be necessary.
__________________
Go FREELANCE <=|If a donkey eats a melon, it is still a donkey... |=> Hire Me
wayfarer07 is offline
Reply With Quote
View Public Profile
 
Old 04-02-2008, 09:01 PM Re: Layout with DIVs
wayfarer07's Avatar
$frontend->developer

Posts: 1,037
Name: Abel Mohler
Location: Asheville, North Carolina USA
Also, I should add, that you only need ONE div to accomplish what you are aiming for. It is generally considered bad form to use many divs when they are not needed.
__________________
Go FREELANCE <=|If a donkey eats a melon, it is still a donkey... |=> Hire Me
wayfarer07 is offline
Reply With Quote
View Public Profile
 
Old 04-02-2008, 09:58 PM Re: Layout with DIVs
Novice Talker

Posts: 12
Name: Zeke
Quote:
Originally Posted by wayfarer07 View Post
I'd like to know why you are concerned with this area resizing? It looks like a very small area, and I don't see how that would be necessary.
I don't need that area to be resizable. I just need a table, but without using a table, since everybody says tables are bad for SEO. Should I use a table anyway?
ZekeLL is offline
Reply With Quote
View Public Profile
 
Old 04-02-2008, 11:27 PM Re: Layout with DIVs
Skilled Talker

Posts: 96
Name: Sandy
Hi,

I thought I would share this web site with you. I know I have a heck of a time with positioning and positioning a div inside a positioned div. Does that make sense. Tab 10 on:

http://www.barelyfitz.com/screencast...s/positioning/

also has more links to pages that can help you as well. I think the problem may be you are positioning a div absolute inside another div that is positioned absolute. I think you may want to use relative for the containing div, but I'm not sure.
The link on the 10th tab I found most useful is:

http://www.autisticcuckoo.net/archiv...ively-absolute

I hope this helps!
__________________
Sandy K
sandyk3 is offline
Reply With Quote
View Public Profile
 
Old 04-03-2008, 12:41 AM Re: Layout with DIVs
wayfarer07's Avatar
$frontend->developer

Posts: 1,037
Name: Abel Mohler
Location: Asheville, North Carolina USA
Quote:
I just need a table, but without using a table, since everybody says tables are bad for SEO. Should I use a table anyway?
I don't know who told you that tables are bad for SEO. They aren't.

However, you are really limiting yourself by only doing layouts with tables. The reason that people like me hate tables are: 1. They leave the code on the document a mess. 2. The are much more limited in what they can do than pure CSS box-model layouts, and 3. They are only practically good for one thing: making charts with data in them. 4. They were never intended for doing layouts, and make things difficult for other standards-following coders to work on your code.

Someone told me once that he thought tables were the "lazy person's" way of doing things. As a lazy person, I object to that assumption.

If you keep relying on tables for everything, you will do nothing but develop habits that will ultimately hold you back when and if you ever have to do a real layout, or work on someone else's layout that does anything besides use silly tables and spacer GIFs to do what is really much easier, with the proper education, to do with divs.
__________________
Go FREELANCE <=|If a donkey eats a melon, it is still a donkey... |=> Hire Me

Last edited by wayfarer07 : 04-03-2008 at 12:44 AM.
wayfarer07 is offline
Reply With Quote
View Public Profile
 
Old 04-03-2008, 02:57 PM Re: Layout with DIVs
LadynRed's Avatar
Super Moderator

Posts: 6,553
Location: Tennessee
Here's a informative presentation on why you should not be using tables for layout:
http://www.hotdesign.com/seybold/everything.html

If you want to learn to transition away from tables, I highly recommend this book:
http://www.sitepoint.com/books/css2/
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Layout with DIVs
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.16611 seconds with 12 queries