Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
What's the purpose of that? I don't do much frontend stuff now but 12 year old me was baffled by that.
-
greyfade1776y@Dummybugger it declares the HTML version being used. Browsers will tend to treat it differently based on the version, and HTML5 in particular imposes some strict guidelines for the browser to obey.
If you don't declare a doctype, it'll just treat it as "tag soup." -
cave8666yMy school didn't teach us that either! I once wrote a website which only worked on chrome because of its fallback mechanism, but problem was I don't even use chrome and it didn't work properly for Firefox (or any other browser). Had to rewrite the whole website, because I don't know how chrome made it work in the first place, this time with <!DOCTYPE HTML>
Our schools never taught me to put "<!DOCTYPE html"
rant