By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,676 Members | 1,759 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,676 IT Pros & Developers. It's quick & easy.

Decent layout not working in IE6 - is there a way to fix it?

P: n/a
Hi,

I've created a layout for an Ajax side that is "single paged" in that
when the browser is resized, so is the page. The header is locked to
the top, the right panel is locked to the right side and the footer is
locked to the bottom leaving the main content area as a scrollable
resiable area in the centre of the window. This works as expected in
FF, Opera, IE7, but not in IE6.

the problem with IE6 is that positioning using left and right and/or
top and bottom doesn't work. You can use left with top/bottom and
right with top/bottom, which is crap.

A working version can be viewed here: http://codedump.archangeli.co.uk.
BTW, It's a PHP page which handles the XHTML stuff in the header.

Now, is there a way to force IE6 to handle this correctly? Possibly by
using JavaScript to set the width and height of the divs when the
browser window changes? This I don't mind as long as I can still have
the divs where I want and any effects on them doesn't cause any
problems?

I've searched for the entire day looking for answers only to find
nothing, so this is my last hope. I've posted the source below for
people to peruse.

Thanks,
Luke.

<?php
if ((stristr($_SERVER['HTTP_ACCEPT'],"application/xhtml+xml"))||
(stristr($_SERVER['HTTP_USER_AGENT'],"Validator"))) {
header("Content-type: application/xhtml+xml");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
}
else {
header("Content-type: text/html");
}
?>
<!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" xml:lang="en" lang="en">
<head>
<title>Test</title>

<link rel="stylesheet" type="text/css" href="styles.css"/>

<script src="scripts/js/mootools.v1.00.js" type="text/javascript"/
>
<script type="text/javascript">
</script>
</head>

<body>
<div id="container">
<div id="header">
Header
</div>

<div id="menu">
<div class="menuitem">
Home
</div>
<div class="menuitem">
Ada
</div>
<div class="menuitem">
C++
</div>
</div>

<div id="columns">
<div id="client">
Client area
</div>

<div id="adverts">
Adverts area
</div>
</div>

<div id="footer">
Footer
</div>
</div>
</body>
</html>

@charset "UTF-8";

body {
font-family: Arial, Verdana, sans-serif;
font-size: 12px;
font-weight: normal;
margin: 0px;

color: #ffffff;
}

#container {
position: absolute;
top: 10px;
bottom: 10px;
left: 10px;
right: 10px;

background-color: #ffbb55;
}

#header {
position: absolute;
width: 100%;
height: 100px;

background-color: #00bb55;
}

#menu {
position: absolute;
top: 100px;
left: 0px;
right: 0px;
height: 30px;
font-weight: bold;
padding: 2px;

background-color: #550000;
}

..menuitem {
text-align: center;
float: left;
width: 50px;
/* height: 28px;*/
/* height: 100%;*/
border: 1px solid white;
}

#columns {
position: absolute;
top: 134px;
bottom: 30px;
left: 0px;
right: 0px;

background-color: #44ff44;
}

#client {
position: absolute;
top: 0px;
left: 0px;
right: 150px;
bottom: 0px;
height: 100%;
overflow: auto;

background-color: #009944;
}

#adverts {
position: absolute;
width: 150px;
height: 100%;
right: 0px;
overflow: auto;

background-color: #006699;
}

#footer {
position: absolute;
bottom: 0px;
width: 100%;
height: 30px;

background-color: #883300;
}

Feb 9 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.