/    Sign up×
Community /Pin to ProfileBookmark

IE and DOCTYPEs (hilarious)

IE will go into standards mode if it simply sees the string [font=courier]<!DOCTYPE[/font] at the very beginning of a document. No joke. It doesn’t even read the external DTD information or even care what version of HTML or XHTML you’re using. Take for example:

[code]<html>
<head>
<title>untitled</title>
<meta http-equiv=”content-type” content=”text/html; charset=utf-8″>
<style type=”text/css”>
div {
width: 50%;
margin: 0 auto;
border: solid #000 1px;
background: #eee;
padding: 1em;
}
</style>
</head>
<body>
<div>test</div>
</body>
</html>[/code]

Notice the omission of the DOCTYPE. This [i]will not[/i] center the element in IE6 due to it not being “standards compliance mode” (I use this term loosely here). Now, add the following line at the top of the document:

[code]<!DOCTYPE IE-SUCKS-HARDCORE>[/code]

Let me know what happens. :rolleyes:

to post a comment
Full-stack Developer

8 Comments(s)

Copy linkTweet thisAlerts:
@MstrBobAug 08.2004 — Wow... that's funny, true, and really, really, really sad...
Copy linkTweet thisAlerts:
@Daniel_TAug 08.2004 — Haha.. but I guess one could expect that sort of thing from IE...
Copy linkTweet thisAlerts:
@Robert_WellockAug 11.2004 — The text string [i]<!DOCTYPE[/i] is all that the slacker browser reads.
Copy linkTweet thisAlerts:
@buntineAug 11.2004 — haha. How did you work that out? Just playing around?
Copy linkTweet thisAlerts:
@johndoe190Aug 11.2004 — What a joke IE is and yeah how did you find that out.
Copy linkTweet thisAlerts:
@CharlesAug 11.2004 — To make matters even worse MSIE will read the rest of the DOCTYPE, and even properly resolve external entities, but only if the document name has an "xml" extension.
Copy linkTweet thisAlerts:
@Khalid_AliAug 11.2004 — [SIZE=4]IE Rocks...[/SIZE]

?

Have you guys ever seen a bug in IE?

have you ever seen any OS level vulnerabilities which could be exploited just using darn JavaScript...

comon all..

And I don't even want to start on how rock stable ActiveXControls are..heheheh

[SIZE=4]IE Rocks...[/SIZE]

if it weren't for IE how would we have out laughters on and off
Copy linkTweet thisAlerts:
@Stephen_PhilbinAug 12.2004 — Just when ya think yer estimation of IE couldn't possibly get any lower..........
×

Success!

Help @fredmv 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,
)...