Stray end tag head как исправить

от admin

Почему валидатор выдает ошибку?

Прохожу курс на htmlacademy, пытаюсь отправить проект на защиту, но не пропускает автоматический валидатор, причем выдает ошибки, которых нет.
P.S. наставники уже не помогают.

1. Пишет, что не указана кодировка, хотя она указана как на странице, так и в атоме, в котором пишу. Везде utf-8.
Так же выдает, что этот тег не закрыт. Пробовал написать его так , все равно пишет, что не закрыт и еще дополнительную ошибку на этот символ.
Еще пишет Bad element name “meta-charset=»utf-8″”: Code point “U+003D” is not allowed

2.Выдает ошибку в нескольких местах «Unmappable byte sequence: “81”. «. Что это означает понять не могу, первое слово вообще даже переводчик не берет.

3. Element “head” is missing a required instance of child element “title”. Так же не могу понять в чем ошибка, код выше.

4. Element “title” not allowed as child of element “meta-charset=»utf-8″” in this context.
Титульный элемент не допускается как дочерний к meta-charset.
Так же не понятно как исправить в связи с вопросами выше.

5. Stray end tag “head”. Переводчик перевел это как «шальное закрытие тега head. Это как понять? Код выше.

6. Start tag “body” seen but an element of the same type was already open. «Начальный тег body виден, но элемент того же типа уже открыт». Но у меня один на странице и он закрыт!

7. End tag for “body” seen, but there were unclosed elements. Говорит о незакрытых элементах, прошелся про каждому — нет незакрытых!

Stray end tag "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?

7 Answers 7

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.

False positive for stray end tags #841

The Nu HTML Checker reports two stray end tags on this page, but both have corresponding start tags.

Error: Stray end tag noscript.
From line 142, column 70; to line 142, column 80
/FONT></B></noscript>↩ <
LL comment: The start tag is on the same line as the end tag (142).

Error: Stray end tag head.
From line 144, column 3; to line 144, column 9
script>↩ </head>↩ <bo
LL comment: The start tag is on line 1.

The text was updated successfully, but these errors were encountered:

For https://www.w3.org/WAI/demos/bad/before/home.html , I suspect it’s related to the <noscript> containing illegal children due to it being within the <head> . Probably that causes the parser to implicitly close the <noscript> tag early, thus making the explicit close </noscript> tag extraneous.

Похожие статьи