Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stray end tag "head"

I have the following html5 code:

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="Style.css" rel="stylesheet" type="text/css"> 
    <title>Catalogo Dischi</title>
        <p class="title"> Catalogo Dischi </p>
    <a id="index">
        <p class="subtitle">Indice</p>
    </a>
    <p class="text">
        <a href="#classic">Musica Classica</a>
        <br/>
        <a href="#jazz">Musica Jazz</a>
        <br/>
        <a href="#country">Musica Country</a>
    </p>
</head>

The code is inside the html tag. I don't understand the reason of this error, I close all tags except for meta and link, which can't be closed, what's the problem?

like image 899
Ramy Al Zuhouri Avatar asked Mar 12 '13 17:03

Ramy Al Zuhouri


3 Answers

you need to understand -- the <head> element defines attributes that are used by the browser, but are not directly visible in the page. The <title> attribute defines the title shown on your browser tab.

After you close the <head> tag, you should open the <body> tag, in which all the content to be shown in the page should go.

Also see http://reference.sitepoint.com/html/page-structure for a basic introduction to these elements.

like image 165
Nick Andriopoulos Avatar answered Sep 27 '22 22:09

Nick Andriopoulos


<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="Style.css" rel="stylesheet" type="text/css"> 
    <title>Catalogo Dischi</title>

</head>

<body>

    <p class="title"> Catalogo Dischi </p>
    <a id="index">
        <p class="subtitle">Indice</p>
    </a>
    <p class="text">
        <a href="#classic">Musica Classica</a>
        <br/>
        <a href="#jazz">Musica Jazz</a>
        <br/>
        <a href="#country">Musica Country</a>
    </p>
</body>
like image 28
internals-in Avatar answered Sep 27 '22 20:09

internals-in


You need to close the head tag after your title and wrap your content in body tags.

like image 31
user1936123 Avatar answered Sep 27 '22 21:09

user1936123