Some common standards that i keep in mind while writing an html code:
1. Avoid using html tags inside <script>:
It would be good if you avoid using html tags inside script tags on the page.
// This is an error!
As mentioned in the HTML 4 Recommendation’s note about specifying non-HTML data in element content, end tags are recognized within SCRIPT elements, but other kinds of markup–such as start tags and comments–are not. This is an unintuitive quirk of SGML for elements defined to have CDATA content.
2. Use Query strings wisely:
You will be using & to tag on multiple query strings. But please do ensure that you don’t use entity keywords in your URL. For instance © would give a copyright symbol. §ion would give replace § with a symbol. You can get to know about the entities here.
3. Incorrect nesting of elements:
Nest html elements properly in the proper order in which they are created. For instance, check the example below:
Incorrect: <b><i>Hello World</b></i>
Correct: <b><i>Hello World</i></b>
4. Always use NAME attribute with IMG or FORM.
5. Use all lower case letters in a DOCTYPE
In a DOCTYPE, the formal public identifier–the quoted string that appears after the PUBLIC keyword–is case sensitive. A common error is to use the following:
<!doctype html public “-//w3c//dtd html 4.0 transitional//en”>
Here the formal public identifier (FPI) is all lowercase. The validator does not recognize the document as HTML 4.0 Transitional since the expected FPI for HTML 4.0 Transitional uses different case:
<!doctype html public “-//W3C//DTD HTML 4.0 Transitional//EN”>
6. “Missing a required sub-element of HEAD”
If you receive the error “Missing a required sub-element of HEAD”, check that you have included the TITLE element in the HEAD. The TITLE element is required in all HTML documents.
7. Avoid Uppercase letters in XHTML tags, thought HTML is fine with it.
In XHTML, unlike HTML, element and attribute names must be all lowercase. For example, onMouseOver is an invalid attribute in XHTML, which requires use of onmouseover instead. Either is fine in HTML.
8. Please do not forget to validate your HTML. You can use the one recommended by W3C: