Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
560 views
in Technique[技术] by (71.8m points)

html - Page stuck in Quirks Mode

Currently the page I am working displays fine in Chrome and Firefox, but in IE9 it is rendering in Quirks mode.

Looking into the issue further, it seems that

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

is always getting commented out. Causing Quirks mode to stay in place as no doctype is specified. Basically, I am trying to force the page to render in normal IE9 and not quirks mode. However, something is causing the comment out. Regretfully, this is a wordpress theme that's why I am having a hard time fixing the issue as I didn't write the original code.

Anyone have suggestions?

Thank you!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I don't know what you mean by "[the doctype] is always getting commented out".

There are many different things that can cause Quirks Mode, see here.

Another common cause is having stuff before the doctype. Even invisible stuff.

You can fix this without debugging the actual problem if you add this in your <head>:

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...