Ramy Al Zuhouri
Ramy Al Zuhouri

Reputation: 22006

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?

Upvotes: 8

Views: 68608

Answers (7)

panky sharma
panky sharma

Reputation: 2189

Error may occured if there is an issue of type or double tab in head section. suppose title is like this

    <title> Foundation </title>>

Then Stray end tag “head” will occur including error in body

If page opened in Chrome then it will add a > right after 'Body' tag

<body>
">"

Upvotes: 2

Makurious
Makurious

Reputation: 1

i solved mine by doing this to my code i show you the tag example so you can see what i did to the tags.

so with a link tag it would be:

<link href='https://fonts.googleapis.com/css?family=Aclonica%7cPlayfair+Display' rel='stylesheet'/> 

notice on the end the link tag just ends with />

Upvotes: 0

Joel A Delphin
Joel A Delphin

Reputation: 1

This is your charset charset=UTF-8" it's missing the " at the beginning.

Upvotes: 0

Neophile
Neophile

Reputation: 1519

In your code you have placed <p> inside <head> when the

starts it indicates body part but so after

all thing goes under body so closing </head> is an error

Upvotes: 0

internals-in
internals-in

Reputation: 5038

<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>

Upvotes: 7

Nick Andriopoulos
Nick Andriopoulos

Reputation: 10653

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.

Upvotes: 10

user1936123
user1936123

Reputation: 216

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

Upvotes: 2

Related Questions