How and why you should set your meta data in html?
In this video we will learn all you need to know about the meta data and why you want to work with it.
Video Transcript
00:00Welcome back
00:01Let's take a break from building things inside of HTML and go back to the head part,
00:05Until now the only thing we had in our head was the title, but actually there is a lot more information
00:10that could go into the background of a site. One of the stuff is also...
00:14browsers as they render a page they need to figure out on the fly what type of fonts should they use
00:19what character set, if it's in English, Japanese, Hebrew, Arabic whatever language it is,
00:30The point of it is that if tell the browser what it is, it's one of the first things you do inside of the head,
00:34you're basically making things go faster, not dramatically faster but it's a really good habit to do it
00:40because it makes sure that the browser, that you're communicating with the browser,
00:43what is the character set that you want to put in
00:46You don't have to worry too much about it, the tag is actually really easy to in HTML5
00:49all you have to do is write the word 'meta' which is for meta information, don't ask me what meta means,
00:55ask someone else but it's basically background information
00:59so 'meta charset' and in the charset itself you set what is the charset and you close the meta tag,
01:05you don't even need to close tag, just meta charset, because it's like a special tag
01:09that has special rules to it. The meta charset basically, all it accepts is the type of font,
01:16now the most common font that you want to use and problably the one you're usually going to be using
01:20is UTF-8. If you're working with the non standard language like maybe japanese
01:25and you might need UTF-16
01:27I'm not going to get into the whole story of it but if you're working in english or any western language
01:33like German or French that's all you need. UTF-8 and you're good
01:37and it's good for most of the languages in the world
01:39there's some that it isn't and in your local world then you'll figure out what's that specific charset
01:43that you want to use or just don't put anything if you're not sure okay ?
01:48That's the meta charset, you won't see anything but that's basically going to enable the browser to know
01:54what's the font that you're using.
01:57Now by the way there're some people that complain when you put a slash here, or don't put a slash here
02:01and they say 'oh you have to be exactly to the specification, it really doesn't matter,
02:04I personally prefer putting a slash even if it's not the way it's supposed to be done
02:09it just makes sense to me, if I'm not going to do a close to a meta tag then I prefer setting it
02:14in that way because to mentally keep things conistantly.
02:18A browser would never make that site not load because of that so you don't have to worry about it too deeply
02:23because you're not breaking the structure of the page. This actually makes a structure more logical.
02:27We saw what's the meta charset, what I want to do in the next video is that I want to talk about meta type
02:33and those meta types are going to enable us to send extra information to search engines
02:37or other reader about stuff that we want to tell them about the page that we couldn't put inside of the page directly
02:43So we'll find out about that in the next video
02:48In this video we're going to talk about another few meta description and I want to just show you first
02:55how you write it and then we'll talk about what they do,
02:58First of all we have the meta which you already met, and I'm going to close it with the slash
03:04and we could give it a name to the different property and the content,
03:07the idea behind it is because you could have a really long list of meta descriptions
03:11and if you have the name which describes what type of meta it is, and the content would be
03:15actually the content itself that you're sending to the whoever is listening
03:19in this case I want to start first with 'author'
03:22and as you might guess we could actually tell search engines who made this page,
03:28so Ben Fhala made this page, I could have multiple authors,
03:32so I could have one author that's Ben Fhala and I could have another author that's 02geek
03:39Basically now noone will see this , it's not visible to users but if a search engine or anyone else
03:45wants to know who made this page they know who the author of the content of this page is
03:50The next meta descriptor that I want to talk about is the keywords
03:55Keywords used to be a really important thing in the good old days of the web
04:00but because a lot of dirty search engine companies used the keywords really often
04:05then most engines don't really care about the keywords attributes anymore
04:09Although it's a good idea to use it, you don't have to get too obsessive about it.
04:13What you want to put inside of it is just in a nutshell a couple of words that describe what's inside of this page
04:18and keywords, just as much as if someone's going to search for us in a search engine,
04:23so this would be 'learn html' or maybe 'learning with mom html'
04:27it could be.. we're talking about the meta tags, and we're talking about author and maybe keywords,
04:34there we go, so we have our few meta tags and this is the description that if search engine wants to lean on it
04:40and they trust us they can look at it and say: okay, we think the information of this page is about that
04:46the next one which is keyword, that's easy enough. It's not really visible but it's very good idea
04:50to always put this stuff in because it's a good habit and a good practice,
04:54The next one is description. A lot more important
04:58The desctiption tag basically happens a lot of times when you search on the search engine,
05:03you have your title and then there's a default line or 2 lines that describes what's inside of that page.
05:10Many times when the search engine does't have anything specific to put inside
05:13they'll use your actual description. So in the description itself we could say here:
05:17learning with mom HTML, in this page we learnt about the meta tags
05:26and literally this is just a background information that is sent over to search engines,
05:34so we have description, and then we put the content itself,
05:37Now, there're other tags, and you could in theory create future tags a well, and it's very open ended
05:42because it's a name context, all you have to do is give it a name and then fill it with a content
05:47do you have any questions about that ?
05:49-no seems very clear and you're explaining it really okay
05:53-thank you,
05:55Don't worry it's not visual at all so we won't even look into the page,
05:59this is nothing you would see in the page itself,
06:01Only search engines see this and other spiders out there would get that information
06:09but users would usually not ever see this directly, although they would see this copy,
06:13maybe in a listing, or they would see this copy when they're searching for your site, and they would find
06:18this line of copy inside of their search result itself,
06:22So that covers meta descritions and we're done with meta.
06:25We're meta over.
06:29That finishes our session 5. ant session 5 was a very heavy session where we learnt about
06:34links, we learnt about iframes and we learnt very important things about the meta description,
06:40how could we describe our page better inside of the header area,
06:43it's time for you to take a break or more accurately it's time for you to star practicing
06:47what we just learnt. Session 6 is going to be very breezy and easy.
06:51We're going to go through a lot of tags, we're going to learn a lot in session 6
06:54but most of the rest of the tags in section 6 are going to be really easy tags to follow and not that hard to consume
07:01so see you in session no.6
