tags:

views:

42

answers:

2

I'm creating a web page with some sort of weird features like scaling and other stuff. The problem that I have is that I cannot pull it off without using JavaScript but if I get rid of the page doctype it can be easily done by HTML/CSS.

What should I do? I want to stick to standards and avoid inconsistencies.

+2  A: 

Yes. Otherwise it tells the browser to render in el-retardo mode. If you are having specific issues, post them.

meder
+1  A: 

XHTML requires a valid DOCTYPE at the top of the document; otherwise, the pages won’t validate and the browsers will fall back into what is known as quirks mode.

Quirks mode occurs when a browser treats a web page as “buggy.” As a result, such pages are treated as though they were written in invalid markup, and therefore will be improperly rendered in modern browsers even if the XHTML and CSS are coded perfectly.

A web page that is without a DOCTYPE, with an older DOCTYPE, or with a typo-riddled DOCTYPE triggers quirks mode. So, when coding pages, make sure to check that the DOCTYPE is both added to the page and typed correctly to ensure that browsers do not render pages in quirks mode.

Note:

  1. HTML 4.01 has three document types: Strict, Transitional, and Frameset.

  2. Both HTML5 and XHTML 1.1 have one document type, but XHTML 1.0, like HTML 4.01, has three.

  3. Only one document type definition (DTD) appears in the HTML document. Use any one of the following DOCTYPEs that best fits your project needs.

CodeToGlory