What is < !DOCTYPE html > In HTML Programming? | Concept Of HTML

Suppose you are given an HTML project assignment in your school and you have no idea what HTML is, then what do you do? 

You surf the net, watch HTML tutorials for hours and then start. So, appreciating all the hard work, you are finally ready to start. As you open up your commander or notepad or whatever place where you type your HTML code, you always start up any HTML project by this code or element - <!DOCTYPE html> Finally you input all the correct codes that you've learnt and then post the assignment to the teacher. Work Done!

You've learnt the purpose of all the elements that you've created but you're still stuck with question - what exactly does <!DOCTYPE html> means? And that's not all, you must've tried to toggle the elements or the codes of different websites for your fun in the inspect menu when you click the right button of your mouse. 

And then, you must've seen random unknown elements that might seem so strange, but one thing that you'll always find common in any website created using html, is that, at the top, <!DOCTYPE html> is always written. So what exactly is this thing? Curious? Let's learn it today, with our today's technological topic titled

What is <!DOCTYPE html> In HTML Programming?


What is HTML?
First of all, let's just have a glimpse at what exactly is HTML. As it is an acronym, HTML stands for HyperText Markup Language.


Let's breakdown and understand what does each word means. First up, HyperText - HyperText is nothing but the text displayed on a device with references to some other text that the reader has to access. And they are typically hyperlinked to other places which are simply Activated by a mouse click or touch. Simple! Like- if you're here and you want to go to our blog's home page, then you simply click the title text - "Enlightened Wisdom: Smart Science" or click on the home icon! 
And there you go, you are on our home page. Same goes with other sites as well. I think this is very cool.
Second up, Markup - This is also very easy to understand, what is markup in real life? A correction or edit to a text! Simple, thats what markup is in html, it provides different fonts and typefaces to your text which makes them more attractive and kind of well looking. It also tells where are the headings, paragraphs etc.


And now, after knowing HyperText and Markup, lets understand what a Language is. We all know what a language is, nothing but a means of communication or a way in which we express our thoughts and feelings to the people. So in HTML, language is nothing but a way to represent the content on your site. It is kind of a language because it has its own code words and elements which are way different than the languages we speak. So that's why it is also known as the "Markup Language".
So, now having to know what is html, that is a way to represent something on a site or a browser, we are now in a position to understand the first thing that's always written in any HTML site - <!DOCTYPE html>. Let's start.

What is <!DOCTYPE html>
Doctype or the document type declaration is the first line of code in any html document. This doctype is an instruction to the web browser which tells about the VERSION of the html page. Well, first of all it is not an html tag. It is just an information to the browser about what document type to expect. Also, keep in mind ALL html documents should have a DOCTYPE. 


So it is compulsory. One more important thing to know that DOCTYPE is also used to inform the website visitor's BROWSER that the document being rendered is an HTML Document. And that's what basically is the task of The Doctype declaration.
So, now we know why <!DOCTYPE html> is used in html. Let's understand another amazing question regarding doctype. What if I don't write <!DOCTYPE html> in my document?
It's an amazing question to ask. Well, if you don't write doctype declaration in your document, the browser enters quirks mode and tries to deal with your code. What's a quirks mode? 

In computing, quirks mode refers to a technique used by some web browsers for the sake of maintaining backward compatibility with web pages designed for old web browsers instead of strictly complying with the standard mode. Well, basically, it is all buggy and old looking. And if we talk about the consequences of not typing the <!DOCTYPE html> in the HTML document, they are also annoying. Not all elements of your page will be displayed correctly, there might be errors and bugs.
So, if we conclude the answer with a moral - A DOCTYPE is compulsory for an HTML document.


And let's end today's session by an amazing fact:
Did you know that "Tim Berners-Lee" was the person who wrote the first version of html in 1993. Since then, html is widely used for many things and is quite popular!


I hope you learned something new and different today. If you liked it, then you may follow us as well.
Thank you for reading.
Created By: Naman Dwivedi
-------------------

8 Comments

Post a Comment

Next Post Previous Post