HTML5 User ManualHTML Coding ConventionYou should follow some convention while using HTML: Use a Consistent CSSA user must use consistent style while writing HTML. It makes the code simpler and more understandable for people. Your code must be small, clean and well-formed. Use Correct Document TypeYou should declare document type at the starting of your code. For example:You can also use <!DOCTYPE html> to maintain your lower case practice. Use Lower Case Element NamesHTML5 facilitates you to use upper case and lower case letters in element name. But it is good practice to use only lower case. Because:
Example:Bad practice: Note: This example will run but it is not a good practice to write elements in uppercase letters.Very Bad practice: Good practice: Close all HTML ElementsIn HTML5, it is not required to close all HTML tags. But, it is recommended to close tags. Bad practice: Good practice: Close empty HTML ElementsIn HTML5, it is not mandatory to close empty HTML tags. You can close it or let it be unclosed. Good practice: Don't Omit <html> and <body>HTML5 facilitates you to omit and tag. You can exclude both tags and the program will work well enough. Example:Test it NowWe recommend you to not to omit and tag because is a root element and specifies the page language. Syntax: Example: Test it NowNext TopicHTML5 Tags |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India