Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
The head section of an HTML document is like the front matter of a book. It's where the information about the document goes. The meta information that describes things about the document that support how it's rendered, how it's navigated, how it's assembled and otherwise how the document works. Let's make a working copy of head.html out of the Chap03 folder of the exercise files. I am going to call this head-working.html, and I am going to go ahead and open this in my text editor here.
And you see down here right after the HTML tag, you see this head tag, and there is the end tag down there. So that's the entire head section of the document right there. Things that go in the head section are considered to be in the metadata content model; these include the title element, meta, link, script, style and base elements. In this example, here on line 6, we have a meta tag, in this case for informing the browser what character set is being used in this document.
Meta can serve many purposes. We'll cover a little more of it later in this chapter. The title element beginning on line 7 is for setting the title of the document. The title element is required in HTML even if it's empty, and there may only be one title element. In the early days of the web people used to put multiple title elements in the document in order to animate the title. This is no longer supported by any of the modern browsers. It was fun while it lasted. The link element is used to create a relationship with other documents, and here we've a link element on line 10.
In this case, we're using it to bring in a stylesheet and this is its most common use, in fact, I don't think I've seen it used for anything else in the long time. It's possible to link other HTML pages and set up relationships of forward and back and such, but most browsers don't support that anymore and nobody ever used those features very much in the first place. So the head section of the document is where information about the document lives. This metadata is critical for describing your document to the browser, to search engines, and to other automated processes that may need to use it.
Get unlimited access to all courses for just $25/month.Become a member
61 Video lessons · 105445 Viewers
56 Video lessons · 117130 Viewers
71 Video lessons · 86354 Viewers
131 Video lessons · 41269 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.