HTML Tutorial — HEAD tag (10/11)
Gonna talk real quick about the HEAD tag because we haven’t paid much attention to it and it’s pretty important. Like I said here: it’s where you put general information about your page.
First child is TITLE This will become the title of your page, when you look at the tab itself. If you don’t add it it’ll just say the name of the file, which sucks. You don’t want that.
META tag is for adding meta information for search engines. Meta tags have a name attribute and a content attribute. If the name is description, the content becomes the description of your page when google displays it in the search results. LIKE THIS
If the name is keywords, the content will be all the keywords that are relative to your content. Here are colorcode’s meta keywords.
There’s an awesome meta tag called viewport, this tells the browser how to scale the page for different device sizes. W3Schools has a good example so I’m just gonna use that one. Here’s a page on a phone, without the viewport, here’s the same page WITH viewport. Here’s the full meta tag that solves the problem:
meta name="viewport" content="width=device-width, initial-scale=1.0"
These things change all the time but at the moment this is it.
You don’t have to remember it, just realize what meta tags are capable of doing. There are other meta tags of course, so we’ll use more of them later.
Other tags, STYLE you can add CSS inside style tags, we WILL talk about CSS A LOT, and soon.
So you see, none of these tags add any content to the page, they don’t show up inside the browser, but they are just as important for the final product.
So that’s a little bit about the HEAD tag. I hinted at CSS a couple of times, we’re almost ready for it but first, HTML identifiers, aka, CSS selectors…..