Next we are going to add some meta data to the header of our file, basically metadata is ‘data about data’, it is the information that tells us all about the type of information we have. Put in realistic terms, think of it like the text on the back of a DVD, it tells you about the film, the data would be the film, and the metadata would be the film preview, rating, approximate running time etc on the back of the box.
In terms of web pages, we can have metadata describing lots of different information about the web page, we are going to add the following.
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="put, lots, of, words, describing, your, web, page, here," />
<meta name="description" content="This is a nice description of your site" />
The first line of metadata displays things like content type and the character set used on your web page, the second line of metadata describes words that are used as keywords for some search engines. In this day and age there are not many search engines that use purely metadata for placement in the results of searches, this is due to people abusing this process to obtain better ranking by repeating keywords more than once. This is not recommended as you could have your site blacklisted. So keep this a good amount of different words about your site no more than 20 words long, and make sure they are words that describe the content on your site. If you site is about cheese on toast, then use the keywords ‘cheese’ and ‘toast’ separated by a comma like above. The description meta tag can be used to describe your website, try to keep this simple, not an essay.
If you like you can insert more metadata like author, the list goes on, these can be set if so desired, but for now we will just concentrate on the important ones.
Lets look at one more thing, you’ll notice that there are no closing tags here when defining metadata, well there are you just cant see them yet. Remember earlier when I said there where two types of tags, the ones that need closing and self closing ones?, no, well I’ll carry on anyway. Lets take a closer look, , this is what is known as a self closing tag, here is an example of an opening and closing tag, and a self closing tag. These are used in various places and it will take some time to figure our when and where to use which.
<p>opening tag with content in it, followed by a closing tag</p>
<br /> Self closing line break tag (enter key, on your keyboard)
<img class="" src="" alt="" /> Self closing image tag to say place an image on the screen
In simple terms if you open a tag it must be closed, this can either be self closing or with a closing tag, this depends on the tag being used. To use containing tags you use open and closing tags. Otherwise self close any tags that are not being used to contain something, never leave a tag open. All tags can have attributes assigned to them in some cases they are compulsory and others they are not.