The English, American or U.S. (United States) Flag De Nederlandse Vlag, de vlag van Nederland

HTML Dictionary - Quirksmode

What is 'quirksmode'?

There are 2 different ways for a browser to show a webpage: the quirksmode (sometimes it's called the 'compatibilitymode'), or the standards-mode. When there's no doctype specified, (actually, that's not allowed, as the doctype is a required element of every html-page), the browser will switch to quirksmode automatically. In the past, it wasn't required to specify a doctope (it simply didn't exist). So if you don't add a doctype, the browser thinks your website is made for an older browser.

What changes in quirksmode?

As the browser thinks your website is made for an older browser, it'll simulate bugs that occured in older browsers. So he deliberately displays your website not correctly.

Why is this useful?

A lot of websites without doctype do are very old. When they were made, they were tested on an older browser. At that time, that browser had some bugs, so a lot of people did't made there websites according the web standards, so the website was showed well by the browser. Later, that bugs were solved. Now, the browsers do are according the webstandards, but the websites aren't. Due to this, websites won't be rendered correct, and that's why the quirksmode is there: in the quirksmode, the browsers pretend to be old browsers (with the bugs), and the website will be rendered correctly.

How do I prevent quirksmode?

For a new website, which is according the webstandards, the quirksmode is not useful at all. That's why you should always specify a doctype. To do this, you should put the following line at the top of your html-page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Then your html-page looks like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    
<head>
        
<title>Title of your website</title>
    
</head>
    
<body>
        Content of your website
    
</body>
</html>
After you've added the doctype, the browser won't get in quirksmode. However, this doesn't mean there aren't any bugs in the browser. The browser still isn't according all web-standards. There'll always be bugs in a browser.


Was this information useful? If so, please consider linking to this website:
Thank you!