This forum is now read-only. Please use our new forums at discuss.codecademy.com.

HTML Basics Forum

View Course » View Exercise

321 points
053b72686ced3564ecbb512b3c5e1674?s=140&d=retro
Submitted by
bobbysmith
almost 4 years ago

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.


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.

421 points
6b23086d69588130423f0e4d14119c28?s=140&d=retro
Submitted by
website-design
almost 4 years ago

1 Comment

053b72686ced3564ecbb512b3c5e1674?s=140&d=retro bobbysmith almost 4 years ago

Thanks.


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.

136 points
52d81d36631fe991a90002ec_943002969
Submitted by
Phil Pickering
over 3 years ago