HTML Title Tag
The HTML Title. The TITLE tag that is located within the HEAD area of the html page is a tag that enables us to give a title to the page. This title is not visible on the page itself but is part of the wrapper of the page. In other words we can usually see it in the window bar itself (outside of the page itself). And it is usually used as the search result copy when users search the web. We will learn how to work with this tag and integrate it into an HTML page. By the way in a later segment we will walk through the steps that optimize our final page.
Video Transcript
00:00So let's put something into the head itself just to showcase how does the head use.
00:04So one tag that you can only put in the head itself is called title tag.
00:09Now the title tag is the same way.
00:10You open and you close the tag.
00:13Every single tag that you create in HTML you have to open it, you have to close it.
00:16If you don't close it, you're creating illegal HTML.
00:20Creating illegal HTML, that means some browsers won't render it correctly.
00:24It means Google and other search engines when they see your page and they see you
00:29created a shitty page, or excuse my French, a sloppy page, a spaghetti page, a page that
00:35wasn't built out correctly, Google's going to say, oh well, this is a crappy page anyways.
00:39Let me skip.
00:40Bad score.
00:41Exactly.
00:42And if you get a bad score on your page, no one's going to see it anyways.
00:44Gotcha.
00:45So it's really important.
00:46You open a tag, you close the tag.
00:47Okay.
00:48And we're going to learn later on after we build it a little bit more how do we find
00:51bugs in our pages and how do we fix them, but that's way too early for that right now.
00:55So in our title itself, and what is the title?
00:57The title is when you, one is also what you see on the header.
01:00Right now we get a default of the name of the file, but that's not very intuitive.
01:05Now the reason why we need a header, if a user wants to bookmark the page and they go into
01:10their bookmarks, you'll see, well, you don't have to see my bookmarks.
01:15But in your bookmarks, if you have a title to your bookmark, then you could then see
01:19what was the page about.
01:21You could find it.
01:22Exactly.
01:23If it's just a file name, then it's not that useful.
01:24That's one.
01:25Two, if you have a few tabs open up at the same time, it would be useful to be able to
01:29know what's inside of the page.
01:31And three, Google and other search engines, so if I just open up a new tab really quickly
01:36and I go to google.com, if I go into Google and I search for my favorite search term,
01:41which is zero to geek, you'll see that zero to geek pop ups, pops up, and you'll
01:46see also some information, so lifetime membership and some information, indispensable action
01:51scripts, some information.
01:53These titles are created from the titles that we put into our HTML page.
01:57For example, zero to geek training on Twitter, that's oh so us, and this title is
02:01generated by Twitter.
02:03So literally the user doesn't have to go into the page to know what's going on.
02:08So to sort that out, and by the way, our title on zero to geek is horrible, it seems
02:12like it's just zero to geek, which we should put a little bit more meat into that title
02:15and we'll take care of that at a later date, maybe when you do your search.
02:19So what we want to do next is we want to put in a title, a good title for our low
02:23world, and a good title for that would be maybe zero to geek hello world, and I'm
02:28just going to make that geek uppercase, because I just like it uppercase, zero
02:33to geek hello world, HTML hello world would probably be the best, HTML hello
02:40world.
02:41We're going to save that, once we save that and we go into our browser and we
02:45click on refresh, you'll see that zero to geek HTML hello world has been
02:48updated in the title, and we can see also in the tab itself, zero to geek HTML hello
02:53world.
02:54So now even if we're on another page, we could very clearly and easily see what's
02:57inside of that page.
02:59Now just the tip in general, when you figure out what title you want to use,
03:03you really want to put there a title that's not too long, that's informational
03:06and easy for people to know what's going to be inside of it before you go
03:09in it, also to make it convenient for them to bookmark, but also to make it
03:12more usable when people search right on Google, because if they don't see
03:16something that's relevant to them, they're not going to click on it, which
03:20makes sense.
