xhtml & ie bitch

S

SpaceGirl

XHTML + IE + correct doctype = trashed rendering (random spaces and gaps,
strange positions on some divs), random horizontal scrollbars in iframes...
and loss of coloured scrollbars, if that's your thing.

XHTML + IE + incorrect (HTML4) doctype = correct rendering.

XHTML + Mozilla/Safari/Firefox/Opera + correct doctype = correct rending.

Wrote a server side script that spits a different doctype out depending on
the users browser. This is getting so like the early days of Netscape,
except this time it's fighting the bugs in IE that's having me rip my hair
out!

If anyone wants the script, I have a stand alone ASP file that does the
trick. Happy to post it somewhere.


m.
 
S

Steve Pugh

SpaceGirl said:
XHTML + IE + correct doctype = trashed rendering (random spaces and gaps,
strange positions on some divs), random horizontal scrollbars in iframes...
and loss of coloured scrollbars, if that's your thing.

Which version of XHTML? Appendix C compliant? Which version of IE?
Which doctype? What was the content-type?

Sounds like you triggered Standards mode (IE6 in standards mdoe
ignores scrollbar colours).
XHTML + IE + incorrect (HTML4) doctype = correct rendering.

Which HTML 4 doctype? Must have been one that triggered Quirks mode.

As IE doesn't render XHTML any different HTML this sounds like a
Quirks vs Standards mode thing. As ever a URL would help.

And presumably IE5.x shows it correctly with either doctype (as IE5.x
only has one rendering mode, which is what IE6's Quirks mode is
apeing).
XHTML + Mozilla/Safari/Firefox/Opera + correct doctype = correct rending.

And what happens when you send these browsers the 'wrong' doctype?
Wrote a server side script that spits a different doctype out depending on
the users browser.

Yuck. What does that do to the cacheability of your pages?

If you need to trigger Quirks mode for some reason then it's better to
omit the doctype altogether.

But fixing your CSS to server appropriate values to appropriate
browsers (tantek hack, etc.) may be a less drastic solution.

Steve
 
S

SpaceGirl

Steve Pugh said:
Which version of XHTML? Appendix C compliant? Which version of IE?
Which doctype? What was the content-type?

This caused the problems to appear:

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

This fixes it in IE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
Sounds like you triggered Standards mode (IE6 in standards mdoe
ignores scrollbar colours).

Yup suspect so
Which HTML 4 doctype? Must have been one that triggered Quirks mode.

See above
As IE doesn't render XHTML any different HTML this sounds like a
Quirks vs Standards mode thing. As ever a URL would help.

Yep... I knew there were issues, but it wasn't until I hit this obscure
problems (horizontal scrolling) that I had to start digging and work out
"why". I cant show you and URL as both sites I had issue with are under
NDAs. You can check out www.garbage.com over the next week or so to see the
resulting site.
And presumably IE5.x shows it correctly with either doctype (as IE5.x
only has one rendering mode, which is what IE6's Quirks mode is
apeing).

Couldn't test... dont have access to IE5. I just tell all IE browsers to
render as HTML
And what happens when you send these browsers the 'wrong' doctype?

It fails safe - I tried the wrong type in Mozilla etc and it appeared to
work fine.
Yuck. What does that do to the cacheability of your pages?

Dont see how it could... same browser will always get the same document, and
my server caches the scripts. The only downside is a small processing hit on
the server when it decides what header to send. But I'm already doing a
process that munges the style sheets because of weirdness on IE/Mac, so I
doubt it's significant.
If you need to trigger Quirks mode for some reason then it's better to
omit the doctype altogether.

Trying to make my sites as accessible and "standard" as possible.
But fixing your CSS to server appropriate values to appropriate
browsers (tantek hack, etc.) may be a less drastic solution.

Doing that already - sadly this particular issue is purely tag related,
rather than CSS. I couldn't fix it in CSS.
 
S

Steve Pugh

SpaceGirl said:
This caused the problems to appear:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Yep that triggers Standards mode.
This fixes it in IE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

Yep that triggers Quirks mode.
Yep... I knew there were issues, but it wasn't until I hit this obscure
problems (horizontal scrolling) that I had to start digging and work out
"why".

Nothing very obscure about it. According to the specs the scrollbars
of frames (i or otherwise) must either be both on or both off
(scrolling="auto" means that if one is needed both will be shown but
if neither are needed neither will be shown), in Standards mode IE
applies this rule.
I cant show you and URL as both sites I had issue with are under
NDAs. You can check out www.garbage.com over the next week or so to see the
resulting site.

I'll try to remember, is there a new album out any time soon?
I hope the new site is better than the junk that's there at the moment
which is a fairly perfect example of almost everything that can be
done wrong on a web site.
Couldn't test... dont have access to IE5. I just tell all IE browsers to
render as HTML

All browsers will render it as HTML anyway (I'm guessing on past posts
that you're serving everything as text/html so you're telling all
browsers that it is HTML, regardless of the doctype used).

This is not an XHTML vs HTML issue at all. You would have exactly the
same issues if you used HTML.

You should try to test in IE5 as even in Quirks mode there are
differences between what IE6 does and what IE5 does.
Dont see how it could... same browser will always get the same document, and
my server caches the scripts. The only downside is a small processing hit on
the server when it decides what header to send. But I'm already doing a
process that munges the style sheets because of weirdness on IE/Mac, so I
doubt it's significant.

The page goes out from your server to a proxy. The proxy is used by
many different users, some of whom have IE, some of whom don't. Either
the proxy server caches the page, in which case some users get the
wrong version, or the proxy server always fetches the page from your
server adding extra time to the transaction.
Trying to make my sites as accessible and "standard" as possible.

By serving XHTML under an HTML doctype? I don't think so.

You'd be much more standards compliant if you wrote HTML and served it
with an accurate doctype. It could trigger quirks mode if you needed
it to and you wouldn't need any silly server side hacks.
Doing that already - sadly this particular issue is purely tag related,
rather than CSS. I couldn't fix it in CSS.

That doesn't means that someone else couldn't fix it. ;-)
Whilst there's nothing you can do about the scrollbars (extraneous or
coloured) except avoid frames of all sorts and resist the temptation
to colour them, the "random spaces and gaps, strange positions on some
divs" probably can be fixed by applying a bit of magic to the CSS.

Steve
 
S

SpaceGirl

Steve Pugh said:
Yep that triggers Standards mode.


Yep that triggers Quirks mode.


Nothing very obscure about it. According to the specs the scrollbars
of frames (i or otherwise) must either be both on or both off
(scrolling="auto" means that if one is needed both will be shown but
if neither are needed neither will be shown), in Standards mode IE
applies this rule.

Didn't know that! Hmmm.... Does the same go for content overflow in layers?
I assume not...
I'll try to remember, is there a new album out any time soon?

Soon... I got the album title and track list here beside me, but it's all
hush hush at the moment :)
I hope the new site is better than the junk that's there at the moment
which is a fairly perfect example of almost everything that can be
done wrong on a web site.

I know... awful isn't it. Cant decide if the new site is better or worse.
It's small, self contained, using lots of layers and iframes but works fine
across most browsers. It does use Flash, but it can be turned off and the
site still works and looks fine. Unfortunately the site is little more than
a wrapper for the labels CMS. The second site which we're doing towards the
end of the year, we'll have much more freedom on.

All browsers will render it as HTML anyway (I'm guessing on past posts
that you're serving everything as text/html so you're telling all
browsers that it is HTML, regardless of the doctype used).

Yeah. Okay.
This is not an XHTML vs HTML issue at all. You would have exactly the
same issues if you used HTML.

No... it's a XHTML vs IE thing :)
You should try to test in IE5 as even in Quirks mode there are
differences between what IE6 does and what IE5 does.

Okay... will do.
The page goes out from your server to a proxy. The proxy is used by
many different users, some of whom have IE, some of whom don't. Either
the proxy server caches the page, in which case some users get the
wrong version, or the proxy server always fetches the page from your
server adding extra time to the transaction.

True! Well the site defaults to XHTML & correct doctype. The site still runs
like that. Just a few minor visible glitches.
By serving XHTML under an HTML doctype? I don't think so.

No... well yes. The doctype is right for browser that can handle it. Perhaps
I should have the site just have no doctype for browsers that cant deal with
it, rather than the HTML doctype?
You'd be much more standards compliant if you wrote HTML and served it
with an accurate doctype. It could trigger quirks mode if you needed
it to and you wouldn't need any silly server side hacks.

ah :)

Hack is still needed for CSS tho.
That doesn't means that someone else couldn't fix it. ;-)
:p

Whilst there's nothing you can do about the scrollbars (extraneous or
coloured) except avoid frames of all sorts and resist the temptation
to colour them, the "random spaces and gaps, strange positions on some
divs" probably can be fixed by applying a bit of magic to the CSS.

Steve

Sadly, I cant avoid iframes because the sites (by their nature... band
sites) are graphic heavy. Wish there was an easier way to load content into
layers and then all my problems would go away. I hate frames, but I'm
trapped by them!

miranda
 
L

Lauri Raittila

Steve said:
And what happens when you send these browsers the 'wrong' doctype?


Yuck. What does that do to the cacheability of your pages?

If you need to trigger Quirks mode for some reason then it's better to
omit the doctype altogether.

And since using XHTML, wouldn't it be easier to use that XML thing, that
trickers quirks in IE.
 
S

Steve Pugh

Lauri Raittila said:
And since using XHTML, wouldn't it be easier to use that XML thing, that
trickers quirks in IE.

Oh yes. Must have bloked that particular nightmare from my mind. ;-)

Use IE's bugs against itself, always a good idea.

Steve
 
S

Steve Pugh

SpaceGirl said:
Didn't know that! Hmmm.... Does the same go for content overflow in layers?
I assume not...

Which content overflow bug/feature do you mean? The fact that IE is
totally incapable of getting the default overflow behaviour correct?
Or the fact that, yes it's neither or both scrollbars on any scrolling
element? Hence the IE-specific (unless anyone else has picked them up)
extensions overflow-x and overflow-y.
Soon... I got the album title and track list here beside me, but it's all
hush hush at the moment :)

Um, haven't you posted the album title already on your fan site?
No... it's a XHTML vs IE thing :)

Try it with an HTML 4.01 Strict doctype, or the HTML 4.01 Transitional
one with URL. They'll trigger Standards mode and show the exact same
problems. It has nothing to do with XHTML at all.
No... well yes. The doctype is right for browser that can handle it. Perhaps
I should have the site just have no doctype for browsers that cant deal with
it, rather than the HTML doctype?

Or follow Lauri's suggestion and include the XML declaration before
the doctype. That causes IE (and Opera 7.0x) to go into Quirks mode
but keeps all other browsers (including Opera 7.1+) in Standards mode.
It also means that the doctype will always match the code, and that
one page will suffice for all browsers.
Sadly, I cant avoid iframes because the sites (by their nature... band
sites) are graphic heavy.

You must know better looking bands than I do. ;-)

But I don't see how your argument stands up - if you load X images on
the first page then it doesn't matter if the site uses frames or not,
those X images still have to download. If the second page loads an
extra Y images then those Y images still have to download whether
they're loading into a frame or not, and the original X should be
cached. The only saving the framed route offers is the HTML to include
all the images and in a well authored modern site with CSS and minimal
presentation crud that saving will likely be less than the size of one
image.
Wish there was an easier way to load content into
layers and then all my problems would go away.

There's XMLHTTP but sadly it's not yet supported by Opera :-(

Steve
 
S

SpaceGirl

Steve Pugh said:
Oh yes. Must have bloked that particular nightmare from my mind. ;-)

Use IE's bugs against itself, always a good idea.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <[email protected]> <http://steve.pugh.net/>

Do either of you have an example of this "fix"?

Thanks! :)

xMiranda
 
S

Steve Pugh

SpaceGirl said:
Do either of you have an example of this "fix"?

Instead of starting your XHTML document with the doctype
e.g.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Start it with the XML declaration and then the doctype
e.g.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Obviously change the encoding to match whatever encoding you are
actually using.

Steve
 
S

SpaceGirl

Instead of starting your XHTML document with the doctype
e.g.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Start it with the XML declaration and then the doctype
e.g.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Obviously change the encoding to match whatever encoding you are
actually using.

Steve


Thank you so much Steve!

xxxxx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top