7

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?

| improve this question | |
9

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.

| improve this answer | |
6
<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>
| improve this answer | |
2

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

| improve this answer | |
2

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>
">"
| improve this answer | |
0

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

| improve this answer | |
0

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

| improve this answer | |
  • I think this line is actually correct: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> – Flimm Nov 10 '16 at 16:52
0

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.