Forum Moderators: not2easy

Message Too Old, No Replies

IE6 specific positioning issue

         

squibs

3:07 pm on Oct 23, 2007 (gmt 0)

10+ Year Member



Anbody know of an IE6 bug (IE7,firefox and opera verified ok) where with a content column and a sidebar floated to the right of it occupy too much space? To clarify, I have a centered overall content div - width 760px containing:

Header
Content 554px ¦ Sidebar width 206px
Footer

The content div contains an image of width 554px and the sidebar has an image of width 206px. The code shown below plays nice in all tested browsers but IE6 where the image in the content div is pushed below the image in the right-floated sidebar - it seems like the image in the content div is being pushed right a couple of pixels.

Can anybody shed any light on this?

CSS


html, body {
margin: 0;
padding: 0;
}

#page-container {
margin: 0;
padding: 0;
width: 760px;
margin: auto;
}

#header {
height: 128px;
}

#footer {
height: 66px;
}

#sidebar-a {
margin: 0;
padding: 0;
float: right;
width: 206px;
height: 922px;
}

#content {
margin: 0;
padding: 0;
background-image: url('images/background.jpg');
background-repeat: repeat-y;
height: 922px;
width: 554px;
}

HTML


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
<title>test</title>
<meta http-equiv="Content-Language" content="en-us" />

<meta http-equiv="imagetoolbar" content="no" />
<meta name="MSSmartTagsPreventParsing" content="true" />

<meta name="description" content="Description" />
<meta name="keywords" content="Keywords" />

<style type="text/css" media="all">@import "master.css";</style>
</head>

<body>
<div id="page-container">

<div id="header"><img src="images/banner.jpg" alt="Banner" /></div>

<div id="sidebar-a"><img src="images/rightbar_home.jpg" alt="Talk to us"><br /><br /><br /><br /><br /></div>

<div id="content"><img src="images/oval_home.jpg" alt="Forest"></div>

<div id="footer"><img src="images/footer.jpg" /></div>

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

tomcatuk

4:50 pm on Oct 23, 2007 (gmt 0)

10+ Year Member



I get this problem - my answer would is to have the combined width of the child elements slightly smaller than the containing parent. Not exactly a fix I know ;)

squibs

8:53 am on Oct 24, 2007 (gmt 0)

10+ Year Member



Thanks for the reply - thing is I build a lot of sites with sliced images so this is not always possible for me. I'm really trying to get away from tables. Does anybody know of a workaround, or of any documentation on this IE6 pecadillo? I don't even know what to google to find it :(

londrum

8:58 pm on Oct 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



are there borders on the images maybe? that will add 2 pixels to each

squibs

9:01 am on Oct 25, 2007 (gmt 0)

10+ Year Member



Nope - the problem only occurs in IE6 - IE7,Opera,Firefox are ok.

penders

1:35 pm on Oct 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



are there borders on the images maybe? that will add 2 pixels to each

Hhhmmm, I'm not sure of the reason either at the mo (?!) but the problem occurs even without the images.

You need to set width:763px on #page-container for the contents to fit!? (3px more than should be necessary)

This sounds a lot like the IE6 3px float bug [positioniseverything.net] - but you already have widths set on your elements, so it should be OK?! I think, however, that it could still be related to this.

However, a possible workaround is to float:left your #content DIV and this seems to work OK.

[edited by: penders at 1:59 pm (utc) on Oct. 25, 2007]

adrianTNT

1:57 pm on Oct 25, 2007 (gmt 0)

10+ Year Member Top Contributors Of The Month



@squibs: Add float:right; in your #content

Edit: I just sa that Penders suggested teh same thing, yes, adding float left or right in your #content seems to be the solution.

[edited by: adrianTNT at 1:58 pm (utc) on Oct. 25, 2007]

squibs

3:38 pm on Oct 25, 2007 (gmt 0)

10+ Year Member



Thanks guys - will try ASAP :)