20

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

Comments
  • 2
    @Alice me too 😂
  • 0
    What's the purpose of that? I don't do much frontend stuff now but 12 year old me was baffled by that.
  • 4
    @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
  • 5
    @gitreflog thanks for expressing my cringe kind dude.
  • 2
    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>
Add Comment