Mobile app version of vmapp.org
Login or Join
Eichhorn148

: 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

@Eichhorn148

Posted in: #Doctype #Html5

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>

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Eichhorn148

3 Comments

Sorted by latest first Latest Oldest Best

 

@Courtney195

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.

10% popularity Vote Up Vote Down


 

@Speyer207

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.

10% popularity Vote Up Vote Down


 

@Barnes591

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme