This forum is now read-only. Please use our new forums! Go to forums

banner
Close banner
0 points
Submitted by bobbysmith
almost 11 years

What is the point of the 'title' tag? Why doesn't 'head' alone suffice?

…as it does by the first ‘p’ tag in a body element?

If there is an explanation, please incorporate it into the lesson itself.

Answer 51e77873631fe98ed5000c83

5 votes

Permalink

The title tag is meant mostly for SEO purposes. It lets the user, and spiders know the content of the page. This is the title that is shown on the top of the browser, in the browser bar. On this page for example it is set to “HTML Basics Forum | Codecademy”. The head tag is meant to store meta information and point to external scripts. The title tag is not the only tag that normally appears in the head, usually there are css files, javascripts, and meta description, and robots information. Here is w3c’s explaination:

The head element is a container for all the head elements. Elements inside head can include scripts, instruct the browser where to find style sheets, provide meta information, and more.

The following tags can be added to the head section: title, style, meta, link, etc..

Here the syntax for the title tag of this page.

   <head>
       <title>HTML Basics Forum | Codecademy</title>
    </head>

If you look at the source code of this page, you can see how complicated the head tag can get.

points
Submitted by website-design
almost 11 years

1 comments

bobbysmith over 10 years

Thanks.

Answer 52d90dd77c82caafa9000b95

0 votes

Permalink

Another very important role of the title tag is that the content of the title element is used by default as the name of the bookmark should a user bookmark your web page.

points
Submitted by Phil Pickering
over 10 years