HTML CODE EXAMPLES
The <!doctype html> [doctype tag]
The <!doctype html> tag should be the first line of code that you should write when it comes to writing html codes. The foremost functionality of the <!doctype html> tag is to tell browsers that the document that is being loaded on is a HTML document.Now you might ask, why is it so important to make mention of this, as if browsers are so dumb ? Ironically, they are. It is imperative to understand that there are several Markup languages available for placing the content online and HTML is just one of them. And that codes written in one language will not be compatible with the other.
So, just imagine you have given forth an invitation to your friends, and that they have mentioned to you that they would all have steak for dinner, and then suddenly on that very day, one of your friend turns up to say that he has become a vegetarian and would only want a vegetarian dish.
Given that you have already prepared and now someone is asking you for a change, realistically speaking,how would that go along with you?
In the case of browsers it is even more complex, for they would have to stick with language specifications mentioned in the page and any sway to the left or to the right would only make them unpopular among users which would subsequently result in their dismissal.
Secondly, as coder you wouldn't want your page half rendered to all your users, all because you failed to make mention of the language that you have used.
So in order to avoid all of these confusions, <!doctype html> is placed at the start of any html code
Please note:<!doctype html> never gets displayed on the browser. Also <!doctype html> is not case sensitive, but make sure to type it correctly.TRY THIS CODE
Output

