Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
The meta tag is used for describing aspects of your HTML document for the benefit of the various processors that will use it. It's meta because it's effectively data about data. This is data that will not be displayed on your page, but can be used by the various processes that use your page like the web server that delivers it or the user's web browser. Let's make a working copy of head.html and I am going to rename this working copy to be head-working.html and open it in my text editor.
And you'll notice right here on line 6 we have a meta tag. The tag name is meta and the attribute is charset and the value is UTF-8. So this is one very common use of the meta tag. It describes the charset being used by this document so the browser can display it properly. Another very common use of the meta tag, and I'm just going to add one here, is to simulate HTTP headers, and this is done with the attribute http-equiv, like that. It's short for equivalent, but just the abbreviation is spelled out there, http-equiv, and I am going to give this something called a refresh header and I'll give it content.
So what this will do is it will wait 3 seconds and then redirect this page to another page. Let's go ahead and open it in the browser so you can see what this does. Go head and open this in Firefox. You'll notice it waits 3 seconds and then it redirects to my homepage. Let me go ahead and open it again so you can see this happen again. It's in our Chapter 03 head-working. So it shows our a page and it waits 3 seconds and then it redirects. Of course you can change this to a 0, and it won't wait at all, it'll go ahead and just redirect immediately.
And that can be useful if a page is moved or something like that, and you don't have sufficient access to the server to be able to actually put in a server redirect. But sometimes, like for instance on my page, I have a little thing called BillyDos. It's an old thing that I did. It's just an animated GIF that makes it look like an old IBM PC, and it runs this whole animation and this takes, I don't know, a fixed number seconds, I don't remember exactly, and when it's all done it redirects to my homepage. So there are a number of uses for that. So how this tab works is it basically tells the browser act as if you had received this header from the server.
It doesn't actually do anything on the server, the server doesn't actually read your HTML file. But it tells a browser, pretend you've got this header from the server along with the other http headers. Another common use of this is, I'm just going to copy and paste this so we can type in another one to say "content-type" and this will mimic a "content-type" header. Again if you don't have enough access to your server to be able to get the server to actually send one of the type that you want, you can tell your browser to act as if you had received this header, and then you would no longer need this charset meta tag as we have on line 6.
Another common application is to create fields that may be used by a search engine to help it find your page. We'll talk more about that later in this chapter. So the meta tag is used to describe various aspects of your HTML page. It's commonly used for setting the character set and other properties with the page and also for helping search engines to properly categorize your page. We'll talk more about that usage in the next movie.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 101705 Viewers
61 Video lessons · 88460 Viewers
71 Video lessons · 72288 Viewers
56 Video lessons · 104011 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.
Your file was successfully uploaded.