Coding Ninjas Logo

Home > HTML Questions > Why do we need to put DOCTYPE tag at the begining of every HTML file?

Why do we need to put DOCTYPE tag at the begining of every HTML file?



Answer:

Every HTML page needs a DOCTYPE tag because it tells the browser which version of HTML the HTML file is written in. This helps the browser to render the file correctly.


Similar Questions