Floating DIVs problem in IE

entherology

New Member
I've been trying to fix this error for a few days now and nothing seems to be correcting the problem. I've researched and researched and all the solutions do nothing!

I've been web designing for a few years and my work has asked me to make a website for them. I decided to use floating DIVs so I could have multiple backgrounds and it works perfectly in every browser except IE! The front page works perfectly (the front page, index.php, is loaded through the wordpress theme) but when I click on any of the other pages in the navigation the elements become destructed! What's wrong with my coding?


Everything is fixed now! The problem was the lack of a html opening tag.
 
Last edited:

sysgenmedia

New Member
Hi there,

I'm not entirely sure what you mean by the Nav Elements becoming deconstructed. I just checked this in both IE8 and IE6 and didn't notice any issues on the about page.

However, there does seem to be a Javascript error somewhere, which is causing an error popup in IE. Details from the about page below:

Message: Expected ';'
Line: 362
Char: 36
Code: 0
URI: http://www.brebc.com.au/about.php

Have you fixed the problem you were having or could you be more specific?

~ Nathan
 

entherology

New Member
Hmmm that's strange!

When I view it in IE7 the divs don't align centered and they're also too narrow and the margins increase by twice the value. I use a mac (which is what I used while building it) so when I get my hands on a PC tomorrow i'll post a screenshot of the differences between firefox and IE.
 

PixelPusher

Super Moderator
Staff member
That js error could be causing the issue. I checked in Chrome and FF and the site layout was correct (centered). You might want to consider cleaning the code up a little though. For example I suggest not using line breaks as a method for adding space, or using tags like "small". Use margins for spacing, that is there intended purpose, and of you want text smaller use font-size?

One other key element missing is a doctype declaration. This could also being causing inconsistencies.
 

sysgenmedia

New Member
This is actually a bit more interesting.

I just had a coworker who still has IE7 give it a test and it looks like it may be an IE7-only bug. Using IE7 the nav generally looks ok, but all of the pages other than the home page aren't centered but are instead left aligned. Everything looks fine in IE8 on the other hand as I mentioned earlier.

May not be the cause of the problem, but I just noticed you don't have an opening html tag on the inner pages. Try adding

Code:
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">

to the inner pages (which you have on the home page) and see if that fixes it.

In these situations one of the best ways to solve the problem is to view the source of a working page and of a non-working page side-by-side and look for differences, which is how I noticed the lack of an opening html tag.

Best of luck!

~ Nathan
 

entherology

New Member
Everything is fine now! It was the opening of a html tag that was the problem!

Thanks for all the tips too, I will take them on board to better my coding.
 

PixelPusher

Super Moderator
Staff member
Everything is fine now! It was the opening of a html tag that was the problem!

Thanks for all the tips too, I will take them on board to better my coding.


HTML:
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">

This was what i was referring to before but I used the wrong term haha...

Anyway glad to see you got it working. let us know if we can help any further.
 
Top