: What will happen if I don't include the HTML DOCTYPE tag? I know adding <!DOCTYPE html> (if using HTML5) on the first line is mandatory. What will happen if I don't include it? Because
I know adding <!DOCTYPE html> (if using HTML5) on the first line is mandatory. What will happen if I don't include it? Because my site still looked the same when I removed it.
<!DOCTYPE html>
<html>
<head>...</head>
<body>...</body>
</html>
More posts by @Eichhorn148
3 Comments
Sorted by latest first Latest Oldest Best
Unexpected issues is what will happen. Some HTML will get rendered oddly, some css will behave unexpected, not sure what JS will do, but I would not be surprised that that'll result in something quirky also.
There really isn't a reason not to do so (apart from some very very very edge cases). Everything might work exactly as you want to. And it could also be that you've created one of those odd situation. And you will spent a lot of time debugging for something that should just work, but somehow doesn't.
Nowadays browsers will auto correct a lot of issues found within the markup of the webpage, however older browsers not so much. So while you see no problem is not necessary true for other visitors.
So I advise that you have valid code to ensure that your website is displayed correctly not just to some visitors, but to all.
It is always recommended to define the doctype at the beginning.
www.w3schools.com/tags/tag_doctype.asp
SEO Aspect: Google does relatively good job with reading incorrect syntaxes.
There is something called "Best Practice" and it's always good to implement best practice just to ensure you may not have any issues.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.