[!] [=title "Week 2: Doctypes"] [=content-]

This is only a part of week 2 - make sure to read through all of the companion pieces!

So far we've been doing HTML pretty minimally: we just open a text file, write some tags, save, and reload. This is all well and good, but there's a subtlety: when you just enter html immediately, the browser has no idea what you're doing. Browsers are pretty smart, so it guesses (by the filename, and by the presence of tags) that it's HTML, but the browser also guesses that you aren't really using HTML properly, and so some features are broken!

This situation is known as quirks mode. It's actually mostly fine - most of the features that it breaks are pretty obscure - but to maintain full compatibility and avoid weird bugs, we should always declare an HTML5 doctype. In fact this is very easy. Just include the following tag at the top of all of your html files:

    <!DOCTYPE html>

This will put your page into standards mode, ensuring correct HTML5 non-quirks behavior. Do not include any text on the same line, so your files should look like

    <!DOCTYPE html>
    <h1>Header!</h1>

Instead of

    <!DOCTYPE html><h1>Header!</h1>

I will not accept any homeworks that don't have a correct doctype. Make sure to memorize the pattern!

[/] [#template.html]