Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What DOCTYPE should I target today?

I'm refactoring a .Net web application that is in

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > 

Right now the approach is just to aim for the stars and go for the latest doctype just because it's latest, I would like to make a wiser choice and target a specific one and for good reasons.

There are similar questions existing but the answers might be outdated now.

What is the difference, advantages, disadvantages between standards and quirks mode, what are some quirks I may run into with differently set doctypes?

I have been told that an XHTML doctype is preferable to integrate AJAX since the UpadtePanel serializes it and to do so needs to have a XHTML do type, to what extent is this true?

And for browser compatibility, in which direction are browsers going in terms of DOCTYPE, is there a common thrend or do they differ?

like image 735
GenEric35 Avatar asked Jul 14 '10 20:07

GenEric35


People also ask

Which DOCTYPE is correct for html5?

doctype html> or <! This is because, html5 is a SGML based, unlike HTML4. 01 or XHTML1. As soon a browser finds <! doctype html> in the starting of an HTML document, it represents the document in standard mode.

What is DOCTYPE on my wifi?

DOCTYPE> declaration lets an Internet browser know a page HTML version or document type.

What is the point of DOCTYPE?

The doctype is used for two things, by different kinds of software: Web browsers use it to determine which rendering mode they should use (more on rendering modes later). Markup validators look at the doctype to determine which rules they should check the document against (more on that later as well).

Is DOCTYPE HTML required?

The HTML document type declaration, also known as DOCTYPE , is the first line of code required in every HTML or XHTML document. The DOCTYPE declaration is an instruction to the web browser about what version of HTML the page is written in. This ensures that the web page is parsed the same way by different web browsers.


2 Answers

HTML5 doctype, which is

<!DOCTYPE html>

XHTML is largely dead as a standard, and never was implemented correctly in most cases.

like image 118
Yann Ramin Avatar answered Sep 27 '22 15:09

Yann Ramin


The new thing is HTML 5.

<!DOCTYPE html> is what you use to specify it. That's it. No DTD name or URL or whatever.

If you're using something that likes XML, like .net, then you might want to use XHTML. But don't do it for any other reason; XHTML never was really popular as a standard, or at least it was almost never used correctly.

like image 25
cHao Avatar answered Sep 27 '22 15:09

cHao