What does the DOCTYPE do in HTML?
HTML5, Web Design
What is the DOCTYPE? When coding in HTML you will see this really weird looking line up there at the top. It usually looks like this:
Simply enough, this line tells the browser what version of HTML is being used to create the website. Back in the day, with HTML4, DOCTYPES were really long lines of text that were almost impossible to remember because they looked like this:
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Frameset//EN” “http://www.w3.org/TR/html4/frameset.dtd”>