Forums

CSS

This topic is locked

body tag and xhtml

Posted 29 Mar 2005 11:20:58
1
has voted
29 Mar 2005 11:20:58 Matt Bailey posted:
I converted a normal html doc to an xhtml doc and now IE seems to be ignoring the background colour applied to my body tag. Anyone know what's going on?

(Everything seems fine in other browsers!)

___________________________________
* Sorry... how do you do that again?... *

Edited by - matm00 on 29 Mar 2005 11:21:47

Replies

Replied 29 Mar 2005 13:10:50
29 Mar 2005 13:10:50 Matt Bailey replied:
Ok, so I've done a little research and it appears that using Transitional XHTML in IE doesn't recognise 'body' as the root tag, but 'html'. So I aplied the same styles on my body tag to the html tag and now it sort of works, but the background colour only extends as far as the bottom of my content. Help!...

It's so frustrating to try and make pages comply to web standards, when the one browser that 90% of the world use refuses to play ball!

___________________________________
* Sorry... how do you do that again?... *
Replied 29 Mar 2005 13:27:04
29 Mar 2005 13:27:04 Matt Bailey replied:
I'll detail my progress here because others may find it useful.

As a long shot I tried applying a width and height of 100% to my 'body' and 'html' tags and this seems to have mostly solved the problem. I didn't think percentage values were that compatible in css, particularly on a height declaration, but in this case they work.

However, the only little gripe is that IE still has a white border a couple of pixels wide on the top, left and bottom, and a thicker white border on the right where the scroll bar would appear if it were needed.

If anyone has anything to add please do...

___________________________________
* Sorry... how do you do that again?... *
Replied 29 Mar 2005 21:27:35
29 Mar 2005 21:27:35 Dave Thomas replied:
u removed all padding and margins too matt?

regards

Dave Thomas
<b>DMX Zone Manager</b>
Replied 29 Mar 2005 22:34:44
29 Mar 2005 22:34:44 Matt Bailey replied:
Well I found out the cause of the problem. I'm using a script called IE7 to fix all of IE6's CSS incompatibilities dean.edwards.name/IE7/. For some reason is doesn't like the XHTML Doctype. I changed it back to the basic 'DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"' and everything is back to normal. Oh well, my intentions were good, but it looks like I'm going to have to hold off switching to XHTML for the time being...

___________________________________
* Sorry... how do you do that again?... *
Replied 30 Mar 2005 12:15:50
30 Mar 2005 12:15:50 Matt Bailey replied:
To add to the above, using DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" puts IE6 into Quirks mode, which renders correctly. It's when it's in Strict mode that it doesn't like the IE7 script.

___________________________________
* Sorry... how do you do that again?... *

Reply to this topic