id: 1
Category: HTML
Rated:
Declaring the document type is a necessity for making a document valid in any coding. To do this, I have listed all the HTML document types, they belong at the TOP of the page, before <html> tag.
Transitional
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
This will be a more relaxed version of HTML. This will allow the use of tables.
Strict
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
The most strict version of HTML.
Frameset
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/frameset.dtd">
This will allow the use of frames.
The three above are the most commonly used, however that doesn't mean you can't use the ones below. They are just versions of HTML.
Now, even if it may seem like I am going to leave you with these coding lines, it's time to find the answers to these questions:
Why do we need these?
You need them for valid code.
What are they used for? They are used to tell the browser what kind of code you will be using. It's also used to validate your page as I said.
Where does this code go?
Right at the very top of your HTML document.
Will it work on all browsers if it's valid?
Probably not. Every browser reads code differently, however, if your code is valid it should work on the most popular browsers out there (IE6/7, firefox, safari). You can test them in other browsers still if you like. It will still look a little different.
3.2
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2.0
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">


