Forum Moderators: not2easy

Message Too Old, No Replies

Switching over having some issues with positions?

basic column layout

         

Slovo

2:05 am on Jan 16, 2008 (gmt 0)

10+ Year Member



Hi guys,...

Trying to make the conversion from html design to css. But I seem to be coming up short. I want a two "header" "content" "right menu" "footer" layout. This is wierd. Everything seems to work fine but in IE7 it renders with the right "menu" div a bit high. And with FF 5.0 (is this latest?) it renders the "menu" div a bit low,.. any help would be great.

CSS:
body{
background-color: #A8EDF4;
}

#wrapper {
margin: auto;
width: 922px;
}

#main{
overflow: auto;
width: 100%;
height: 1000px;
}

#top{
background-color: #A8EDF4;
text-align: left;
width: 922px;
height: 50px;
margin: 0px;
}

#head{
background: url(images/temp_head.jpg);
height: 175px;

}
#main-body{
height: 350px;
background-color: #000000;
width: 662px;
float: left;
padding: 5px;
}
#right-col{

height: 350px;
width: 250px;
margin-left: 672px;
background: #CCCCCC;

}
.top-text{
padding-top: 15px;
padding-left: 5px;
font-family: Arial, Helvetica, sans-serif;
font-size: 24px;

}

XHTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<link rel="stylesheet" type="text/css" href="hds4.css" />
</head>

<body>
<div id="wrapper">
<div id="main">
<div id="top">
<p class="top-text">Trying</p>
</div>
<div id="head">
</div>
<div id="main-body">
<p>Body test</p>
</div>
<div id="right-col">
<p>right column test</p>
</div>
<div id="foot">
</div>
</div>
</div>
</body>
</html>

Oh yeah and its centered,... thanks! And yeah I'm new to the forums,..

Slovo

2:37 pm on Jan 16, 2008 (gmt 0)

10+ Year Member



*bump

Slovo

1:40 pm on Jan 17, 2008 (gmt 0)

10+ Year Member



no help aye?

varya

2:29 pm on Jan 17, 2008 (gmt 0)

10+ Year Member



Welcome to Webmasterworld!

The height difference and positioning problem in both browsers can be fixed by adding padding:5px; to right-top.

Your wrapper div isn't wide enough. It produced horizontal scroll bars in both ie and firefox for me, and after I added padding to right-top, that div dropped below main-body in ie 7. When I changed the width of wrapper to 940px, everything lined up properly.

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<style>
body{
background-color: #A8EDF4;
}

#wrapper {
margin: auto;
width: 940px;
}

#main{
overflow: auto;
width: 100%;
height: 1000px;
}

#top{
background-color: #A8EDF4;
text-align: left;
width: 922px;
height: 50px;
margin: 0px;
}

#head{
background: url(images/temp_head.jpg);
height: 175px;

}
#main-body{
height: 350px;
background-color: #000000;
width: 662px;
float: left;
padding: 5px;
}
#right-col{

height: 350px;
width: 250px;
margin-left: 672px;
background: #CCCCCC;
padding: 5px;

}
.top-text{
padding-top: 15px;
padding-left: 5px;
font-family: Arial, Helvetica, sans-serif;
font-size: 24px;

}
</style>
</head>

<body>
<div id="wrapper">
<div id="main">
<div id="top">
<p class="top-text">Trying</p>
</div>
<div id="head">
</div>
<div id="main-body">
<p>Body test</p>
</div>
<div id="right-col">
<p>right column test</p>
</div>
<div id="foot">
</div>
</div>
</div>
</body>
</html>

Slovo

6:34 pm on Jan 17, 2008 (gmt 0)

10+ Year Member



Ahh ok,.. thanks I'll have a look at that.