I want to know what HTML tags are "compulsory" a web-page should have, in order for it to be displayed by a web-browser.
Also, what is the difference between different versions of HTML, in general?
|
I want to know what HTML tags are "compulsory" a web-page should have, in order for it to be displayed by a web-browser. Also, what is the difference between different versions of HTML, in general? |
|||
|
|
|
The absolute minimum HTML you need to create a page that the W3C's validator considers valid is:
The doctype declaration says that we're using HTML5. The
You can improve on this further by telling the browser that we're using a UTF-8 character set, and that the primary language of the document is English:
Next, we'll add an external stylesheet and tell Internet Explorer to use the Chrome Frame Plugin if the visitor's using it, which tends to improve page layout glitches:
This is now approaching the minimum I'd start with. In practice, I'd normally set up a container
This gives you more control over the central page element -- you can centre all page content (and have a full-width background image in the page body) by editing your
Regarding different HTML versions, they are simply incremental revisions. 'HTML5' is the fifth revision of the HTML specification, with a wide range of differences and improvements over HTML4. As such, it almost always makes sense to use the latest version (by starting your document with |
|||||||||||
|
|
I'm going to say none.
Just create a .html file and put in it:
It will display in all web browsers. If you want to drop lines:
I'd say that's the bare minimum as a direct and probably unpopular answer to your question. The other answers have more what you should have as a standards compliant minimum. |
|||||
|
|
The bare essentials you need for a valid HTML5 document, as oulined in Bruce Lawson's blog are
The unclosed In reality any web page that has more than just a few paragraph of text will also heavily use The website html5.org has a useful list of all currently valid HTML elements, including the new HTML5 ones. |
||||
|
|
|
By the letter of the HTML 4.01 standard, the only compulsory element is
|
|||
|
|