tags:

views:

50

answers:

2

Hey,

It's just insane, I've made soo many websites and still it seems every time IE7 and IE8 behave differently every time!!

I'm working on a friends website: Class One

Except I can't seem to get my head around why IE7 and 8 seem to be adding in extra spacing. The positioning of the text overlay div on the jquery slider is off a few pixels and wont cover the full width and the inner div float left content just looks way off, why wont it meet the float right, the maths is right!

I would normally attach code if I knew the problem area but It would be an awful lot of css and html to attach so just put the link up instead.

Thanks in advance!

P.S. I am aware of the php error code, I am getting the hosting provider to sort that as I type! :)

Turns out the php warning is before the doc type so this maybe it?

A: 

Ever heard of the IE box model? It's so fun.

Here's some info:
http://stuffthathappens.com/blog/2007/09/12/ie-and-the-css-box-model-wronger-than-wrong/

Summary of IE hacks found to deal with your problems:
http://www.positioniseverything.net/articles/ie7-dehacker.html

Differences in IE 8:
http://www.evotech.net/blog/2009/03/ie8-css-support/

js1568
Yeh I've been making websites for 8 years, I know the box model stuff and the problems it poses in IE and it's bugs. I usually find a work around through trial and error however it appears the answer above got it, I didnt realise the error was confusing IE.... thanks anyway
Stefan
+2  A: 

The major problem here is the DOCTYPE. This tag must be the first tag in you code, but isn't, because of the PHP Warning. See:

<br />
<b>Warning</b>:  mkdir() [<a href='function.mkdir'>function.mkdir</a>]: Permission denied in <b>C:\Program Files\HSphere\3rdparty\PHP\PHP5\prepend.php</b> on line <b>33</b><br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;

Change beginning of output to

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;

If you don't put this tag in the first line, IE will activate quirks mode, and very strange things will happen. When a browser activate quirks mode, many things change, as box model.

NOTE: many browsers has quirks mode, not only IE (I know that firefox has too).


Note: correct use of DOCTYPE will reduce the differences between IE7 and IE8, but not remove all of them.

Topera