The next section of the document is the head
, which provides the browser with all sorts of different types of information that will help it display the page properly. Nothing inside the head
element will appear on the actual web page.
Meta
tags can have many uses, but the one that should be included on every page has the attribute charset="utf-8"
, which tells the browser what set of characters to use when displaying text. The meta
tag is special type of element (called an empty element) that will be discussed more later. For now, all you need to know is that it does not have a closing tag. Instead, it closes itself, which is done by ending the tag with " />
" (without the quotes); however, the space-slash is no longer required in HTML5.
The title
element is one of the most important in the document. This will be displayed as the page title in the browser's tab, and it is one of the things that search engines like Google look at when they pull up relevant search results. The title
should be relatively short and meaningful.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Write your title here.</title> </head>
</html>