473,394 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

div positioning changes between IE6 and IE7

Hi,

I'm having a problem with the positioning of DIV content.

The layout works fine with most browsers that I've tested, including IE7, and also seems fine on IE5, but for some reason IE6 shifts the DIV content 300px to the right.

Check out: http://www.onlinesimon.co.uk/home.asp for an example of this.

Features two nested DIV's, one overlaying the other. Both contained within a 'container' DIV:
Expand|Select|Wrap|Line Numbers
  1.  
  2. --- CSS ---
  3.  
  4. .blend {-moz-opacity:0.6;filter:alpha(opacity=60);}
  5.  
  6. --- HTML EXAMPLE ---
  7.  
  8. <div style="width:600px;height:370px;">
  9.  
  10. <div id="mContainer" style="position:relative;left:0px;top:0px;" zorder="1"></div>
  11.  
  12. <div style="position:relative;top:0;left:0;z-order:3;background-image:url('http://www.onlinesimon.co.uk/images/putsch_overlay.gif');background-repeat:no-repeat;text-align:left;"><img class="blend" border="0" src="http://www.onlinesimon.co.uk/images/putsch.gif" alt="Putsch Architectural Glass" width="34" height="350"></div>
  13.  
  14. </div>
  15.  
  16. --- END OF HTML EXAMPLE ---
  17.  
  18.  
The above code works fine in IE7 and most other browsers - just not in IE6.

Any ideas? I'd rather know what I'm doing wrong then have to create a 'work-around' fix for IE6. The only quick solution is to go back to using tables, which is less than ideal.

Regards,
Simon
Nov 13 '06 #1
4 5261
drhowarddrfine
7,435 Expert 4TB
You are using the xml declaration on the first line. This:
<?xml version="1.0" encoding="iso-8859-1"?>

Only modern browsers work correctly with it, IE6 goes into quirks mode. Remove that line. Then validate and fix your 35 html errors and then your css errors.
Nov 13 '06 #2
You are using the xml declaration on the first line. This:
<?xml version="1.0" encoding="iso-8859-1"?>

Only modern browsers work correctly with it, IE6 goes into quirks mode. Remove that line. Then validate and fix your 35 html errors and then your css errors.
Thank you for the reply. I've fixed those errors and the page now validates to XHTML Transitional.

The page views fine with IE7, (and to a slightly lesser degree Firefox 2), but the main problem I have is with IE6.

If you look at http://www.onlinesimon.co.uk/home.asp on IE6 or earlier (I've tried it also on IE5.5) then the large fading image at the top of the page is offset by about 300px to the right of its intended position.

Expand|Select|Wrap|Line Numbers
  1. <div id="mContainer" style="position:relative;left:0px;top:0px;z-index:1;"></div>
The above DIV is fine in IE7 and Firefox 2, but on IE6 is offset 300px to the right?

Any ideas?

Regards,
Simon
Nov 14 '06 #3
Fixed the problem now. Page is looking 99% the same across browsers.
Nov 14 '06 #4
What was the fix ?
Nov 22 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

36
by: Jack Hughes | last post by:
This argument has come up two or three times lately. We have a web standards document at our company that say "Use valid HTML 4; We don't recommend switching to DIV-based CSS-P for layout just...
3
by: Mike Anderson | last post by:
I'm having a problem with the positioning of a div block in IE6. http://www.uah.edu/Athletics/index.shtml When the window is resized to a width smaller than the width of the "body" div (that...
4
by: Jane Withnolastname | last post by:
I am trying to re-work an old site by replacing the html with css. On the main page, I have a logo image which I needed centred on the initial screen. I found the solution here:...
3
by: Joni | last post by:
Hello NG, I am quite new to CSS and currently trying to change our sites to better use CSS for easier site style/layout configuration. I am having some problems and I couldn't find any good...
2
by: Christoffer Berg | last post by:
Hi I'm having some trouble positioning blocks inside other blocks. The way I understand it "position: absolute;" means that the position is relative to the parent's upper left corner. This...
4
by: salty_dogs | last post by:
i have a site that works well in ie6 for the pc. but i've also seen it (don't have a mac) with ie for mac and safari. both of these browsers produce different and unwanted results. the biggest...
11
by: NS | last post by:
I am relativly new to css positioning and have a question regarding the display of a DHTML pop-up Here is the basic HTML I am using: <html> <head> <script language="JavaScript"> <!--
2
by: nino9stars | last post by:
Hello, I have just started messing with absolute positioning on webpages, and it definitely let's you do some creative things. Well, after much searching and help, I got the images I was using...
1
by: Froggluver | last post by:
I have some experience with CSS. Just enough to be dangerous in fact. :) I had a general question about positioning. Is it possible create a box that is absolutely positioned on a page, and then...
1
by: C. (http://symcbean.blogspot.com/) | last post by:
On Aug 12, 7:08 am, long_way <yilongwei....@gmail.comwrote: Hi, Wouldn't it just be simpler to use Google maps? I'm not overly familiar with greybox, but it should be fairly straightforward...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.