Layout with DIVs

ZekeLL

New Member
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:

f_outputm_e433d1c.jpg


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:

f_screenshot1m_fd5467c.jpg


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

f_screenshot2m_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. :)
 

publik

New Member
I'm not a pro or anything but this probably isn't the best way to do it, but try something like what is shown below, then just play around with the styles.

<html>
<head>
<title>Bog Squad</title>
<link href="master.css" rel="stylesheet" type="text/css" />

</head>

<body>
<div id="wrap">

<div id="content">

<div id="toprow">
<div class="left">Top Left</div>
<div class="right">Top right</div>
</div>

<div id="middlerow">
<div class="left">Middle Left</div>
<div class="right">Middle Right</div>
</div>

<div id="bottomrow">
<div class="left">Bottom Left</div>
<div class="right">Bottom Right</div>
</div>
</div>

</div>
</body>
</html>



And CSS would be in external file like this:


#wrap {
margin:auto;
}

#content {
margin:auto;
width:700px;
height:600px;
background-color:#666666;
}

#toprow, #middlerow, #bottomrow {
display:block;
}

.left {
float:left;
}

.right {
float:right;
border:solid 1px #ffffff;
width:350px;
height:200px;
}

#middlerow {
clear:both;
}

#bottomrow {
clear:both;
}
 
Top