Note that you don't actually need the head or body tags in your page. The browser already knows what is allowed in the head. It looks weird at first, but you can write your html like so:
<!doctype html>
<html lang="en">
<title>My Title</title>
<div id="main"></div>
Also note that the html tag can also be omitted, unless you need to set the language. Don't worry about closing it either.