20

Our schools never taught me to put "<!DOCTYPE html"

Comments
  • 6
    I hate your school.
  • 2
    hahahhahah

    ah. it's so frickin true.
  • 4
  • 0
    What's the purpose of that? I don't do much frontend stuff now but 12 year old me was baffled by that.
  • 6
    @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."
  • 3
    YOU GOT UNBALANCED BRACKETS AAAAAAA
  • 3
    @gitreflog thanks for expressing my cringe kind dude.
  • 3
    My 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>
Your Job Suck?
Get a Better Job
Add Comment