/    Sign up×
Community /Pin to ProfileBookmark

XML Declaration screwing up IE 6?

When I use the XML declaration (<?xml version=”1.0″ encoding=”utf-8″?>), IE messes up the box model. But as soon as I remove it, everything works.

Explain?

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@StefanJan 01.2003 — [i]Originally posted by spoontacular [/i]

[B]When I use the XML declaration (<?xml version="1.0" encoding="utf-8"?>), IE messes up the box model. But as soon as I remove it, everything works.



Explain? [/B]
[/QUOTE]


Well know bug in IE/win 6 regarding it's doctype sniffing.

With the XML decl it incorrectly reverts to quiks/non standards mode as it fails to find the doctype.

Since the XML declaration is optional, just leave it out and IE 6 will go into standards compliant mode.

It's just yet one of those "how did the manage to botch thatone up in the final release" in IE.

Just remeber to add the charencoding metatag as well as the xhtml namespace in the <html> tag and you'll be fine ?
Copy linkTweet thisAlerts:
@jeffmottJan 01.2003 — [i]Stefan[/i]

[b]Since the XML declaration is optional[/b][/quote]


But only if you plan on using either UTF-8 or UTF-16. If you do omit, in your text editor you will have to save as and choose an encoding of one of the two encodings listed above.
Copy linkTweet thisAlerts:
@StefanJan 02.2003 — [i]Originally posted by jeffmott [/i]

[B]But only if you plan on using either UTF-8 or UTF-16. If you do omit, in your text editor you will have to save as and choose an encoding of one of the two encodings listed above. [/B][/QUOTE]


Unless of cource you have the option to set the charencoding in the HTTP header.
×

Success!

Help @spoontacular spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...