Error attribute name not allowed on element meta at this point

I am having the error multiple times here ​ http://validator.w3.org/check?uri=http%3...

Between two meta tags, the one with name="description" and the one with name="keywords", the page contains the bytes 0xE2 0x80 0x8B (and some whitespace). The page is being interpreted as UTF-8 encoded, but that sequence of bytes is malformed UTF-8 (does not represent any character). Apparently, the validator still interprets it as a data character. This causes the head element to be prematurely closed, and the rest is… well, not history, but a consequence of this confusion. The second of the meta tags is taken as being in the body part, and there special rules apply, making the tag invalid.

The real problem, anyway, is the presence of the bogus bytes 0xE2 0x80 0x8B. When they are removed, the page validates.

It is impossible to know, from outside, what produces those bytes. But they look suspiciously like a character encoding error, possibly causes by incorrectly performed UTF-8 encoding of some data that was already UTF-8 encoded, or something like that.

This was a tricky issue. I had to use Rex Swain’s HTTP Viewer to check the raw data of the offending page.

Rocket Validator integrates the W3C Validator HTML checker
into an automated web crawler.

  • meta

  • name

A <meta> tag has been found that is either malformed, or in a bad place within the document. Check its attributes and context.

For example, the following HTML contains a valid <meta> tag that is raising an issue because of bad context, caused by an <img> tag that shouldn’t be there:

<!DOCTYPE html>
<html lang="">
  <head>
    <title>Test</title>
    <img src="photo.jpg" alt="A smiling cat" />
    <meta name="description" content="Description of this page" />
  </head>
  <body>
    <p>Some content</p>
  </body>
</html>

If we fix that document and move the <img> tag within the body, the issue raised about <meta> disappears because it’s now in a valid context:

<!DOCTYPE html>
<html lang="">
  <head>
    <title>Test</title>
    <meta name="description" content="Description of this page" />
  </head>
  <body>
    <p>Some content</p>
    <img src="photo.jpg" alt="A smiling cat" />
  </body>
</html>

Learn more:

  • HTML Spec: the meta element

Related W3C validator issues

Проверка валидности HTML кода сайта обязательно входит в мой технический аудит. Но не нужно переоценивать значимость ошибок валидации на SEO продвижение — она очень мала. По любой тематике в ТОП будут сайты с большим количеством таких ошибок и прекрасно себе живут.

НО! Отсутствие технических ошибок на сайте является фактором ранжирования, и поэтому пренебрегать такой возможностью не стоит. Лучше исправить, хуже точно не будет. Поисковики увидят ваши старания и дадут маленький плюсик в карму.

Читайте также: кем и когда был введен гипертекст

Как проверить сайт на валидность HTML кода

Проверяется валидация кода сайта с помощью онлайн сервиса W3C HTML Validator. Если есть ошибки, то сервис выдает вам список. Сейчас я разберу самые распространенные типы ошибок, которые я встречал на сайтах.

  • Error: Duplicate ID min_value_62222

Error Duplicate ID min_value_62222

И за этой ошибкой такое предупреждение.

  • Warning: The first occurrence of ID min_value_62222 was here

Warning The first occurrence of ID min_value_62222 was here

Это значит, что дублируется стилевой идентификатор ID, который по правилам валидности html должен быть уникальным. Вместо ID для повторяющихся объектов можно использовать CLASS.

Исправлять это желательно, но не очень критично. Если очень много таких ошибок, то лучше исправить.

Аналогично могут быть еще такие варианты:

  • Error: Duplicate ID placeWorkTimes
  • Error: Duplicate ID callbackCss-css
  • Error: Duplicate ID Capa_1

Следующее очень распространенное предупреждение.

  • Warning: The type attribute is unnecessary for JavaScript resources

Warning The type attribute is unnecessary for JavaScript resources

Это очень частая ошибка при проверке валидации сайта. По правилам HTML5 атрибут type для тега script не нужен, это устаревший элемент.

Аналогично такое предупреждение для стилей:

  • Warning: The type attribute for the style element is not needed and should be omitted

Warning The type attribute for the style element is not needed and should be omitted

Исправлять эти предупреждения желательно, но не критично. При большом количестве лучше исправить.

  • Warning: Consider avoiding viewport values that prevent users from resizing documents

Warning Consider avoiding viewport values that prevent users from resizing documents

Это предупреждение показывает, что нельзя увеличить размер страницы на мобильном или планшете. То есть пользователь захотел посмотреть поближе картинки или очень маленький текст и не может этого сделать.

Я считаю это предупреждение очень нежелательным, для пользователя неудобно, это минус к поведенческим. Устраняется удалением этих элементов — maximum-scale=1.0 и user-scalable=no.

  • Error: The itemprop attribute was specified, but the element is not a property of any item

Error The itemprop attribute was specified, but the element is not a property of any item

Это микроразметка, атрибут itemprop должен находиться внутри элемента с itemscope. Я считаю эту ошибку не критичной и можно оставлять как есть.

  • Warning: Documents should not use about:legacy-compat, except if generated by legacy systems that can’t output the standard doctype

Warning Documents should not use about legacy-compat, except if generated by legacy systems that can't output the standard doctype

Строка about:legacy-compat нужна только для html-генераторов. Здесь нужно просто сделать но ошибка совсем не критичная.

  • Error: Stray end tag source

Error Stray end tag source

Если посмотреть в коде самого сайта и найти этот элемент, видно, что одиночный тег <source> прописан как парный — это не верно.

одиночный тег source

Соответственно, нужно убрать из кода закрывающий тег </source>. Аналогично этой ошибке могут встречаться теги </meta> </input> </noscript>. Эту ошибку нужно исправлять.

  • Error: An img element must have an alt attribute, except under certain conditions. For details, consult guidance on providing text alternatives for images

Error An img element must have an alt attribute, except under certain conditions For details, consult guidance on providing text alternatives for images

Все картинки должны иметь атрибут alt, я считаю эту ошибку критичной, ее нужно исправлять.

  • Error: Element ol not allowed as child of element ul in this context. (Suppressing further errors from this subtree.)

Error Element ol not allowed as child of element ul in this context Suppressing further errors from this subtree

Здесь не верно прописана вложенность тегов. В <ul> должны быть только <li>. В данном примере эти элементы вообще не нужны.

неправильная вложенность тегов

Аналогично могут быть еще такие ошибки:

  • Element h2 not allowed as child of element ul in this context.
  • Element a not allowed as child of element ul in this context.
  • Element noindex not allowed as child of element li in this context.
  • Element div not allowed as child of element ul in this context.

Это все нужно исправлять.

  • Error: Attribute http-equiv not allowed on element meta at this point

Error Attribute http-equiv not allowed on element meta at this point

Атрибут http-equiv не предназначен для элемента meta, нужно убрать его или заменить.

Аналогичные ошибки:

  • Error: Attribute n2-lightbox not allowed on element a at this point.
  • Error: Attribute asyncsrc not allowed on element script at this point.
  • Error: Attribute price not allowed on element option at this point.
  • Error: Attribute hashstring not allowed on element span at this point.

Здесь также нужно или убрать атрибуты n2-lightbox, asyncsrc, price, hashstring или заменить их на другие варианты.

  • Error: Bad start tag in img in head

Error Bad start tag in img in head

Или вот так:

  • Error: Bad start tag in div in head

Error Bad start tag in div in head

Тегов img и div не должно быть в <head>. Эту ошибку нужно исправлять.

  • Error: CSS: Parse Error

Error CSS Parse Error

В данном случае здесь не должно быть точки с запятой после скобки в стилях.

не должно быть точки с запятой в стилях

Ну такая ошибка, мелочь, но не приятно) Смотрите сами, нужно убирать это или нет, на продвижение сайта никакой совершенно роли не окажет.

  • Warning: The charset attribute on the script element is obsolete

Warning The charset attribute on the script element is obsolete

В скриптах уже не нужно прописывать кодировку, это устаревший элемент. Предупреждение не критичное, на ваше усмотрение.

  • Error: Element script must not have attribute charset unless attribute src is also specified

Error Element script must not have attribute charset unless attribute src is also specified

В этой ошибке нужно убрать из скрипта атрибут charset=»uft-8″, так как он показывает кодировку вне скрипта. Я считаю, эту ошибку нужно исправлять.

  • Warning: Empty heading

Warning Empty heading

Здесь пустой заголовок h1. Нужно удалить теги <h1></h1> или поместить между ними заголовок. Ошибка критичная.

  • Error: End tag br

Error End tag br

Тег br одиночный, а сделан как будто закрывающий парный. Нужно убрать / из тега.

одиночный тег br

  • Error: Named character reference was not terminated by a semicolon. (Or & should have been escaped as &.)

Error Named character reference was not terminated by a semicolon

спецсимволы html

Это спецсимволы HTML, правильно нужно писать &copy; или &amp;copy. Лучше эту ошибку исправить.

  • Fatal Error: Cannot recover after last error. Any further errors will be ignored

Fatal Error Cannot recover after last error Any further errors will be ignored

Это серьезная ошибка:

код после html

После </html> ничего вообще не должно быть, так как это последний закрывающий тег страницы. Нужно удалять все, что после него или переносить выше.

  • Error: CSS: right: only 0 can be a unit. You must put a unit after your number

Error CSS right only 0 can be a unit You must put a unit after your number

Нужно значение в px написать:

значения в коде

Вот аналогичная ошибка:

  • Error: CSS: margin-top: only 0 can be a unit. You must put a unit after your number

Error CSS margin-top only 0 can be a unit You must put a unit after your number

  • Error: Unclosed element a

Error Unclosed element a

<a></a> — это парный тег, а здесь он не закрыт, соответственно, нужно закрыть. Ошибку исправлять.

  • Error: Start tag a seen but an element of the same type was already open

Где-то раньше уже был открыт тег <a> и не закрыт, откуда идет следующая ошибка.

  • Error: End tag a violates nesting rules

Здесь отсутствие закрывающего тега </a> нарушает правила вложенности, откуда идет уже фатальная ошибка.

  • Fatal Error: Cannot recover after last error. Any further errors will be ignored

Это частный случай, так конечно нужно смотреть индивидуально.

  • Warning: The bdi element is not supported in all browsers. Please be sure to test, and consider using a polyfill

Warning The bdi element is not supported in all browsers Please be sure to test, and consider using a polyfill

Элемент bdi не поддерживается во всех браузерах, лучше использовать стили CSS, если нужно изменить направления вывода текста. Это не критичное предупреждение.

  • Error: A document must not include both a meta element with an http-equiv attribute whose value is content-type, and a meta element with a charset attribute

Error A document must not include both a meta element with an http-equiv attribute whose value is content-type and a meta element with a charset attribute

Здесь 2 раза указана кодировка:

двойная кодировка

Нужно убрать <meta charset=»UTF-8″ /> в начале. Ошибку лучше исправить.

  • Error: Bad value callto:+7 (473) 263-22-06 for attribute href on element a: Illegal character in scheme data: space is not allowed

Error Bad value callto 7 495 263-22-06 for attribute href on element a Illegal character in scheme data space is not allowed

Здесь запрещены пробелы для атрибута href, нужно писать так — callto:74732632206. Ошибку лучше исправить, но не критично.

  • Error: CSS: max-width: Too many values or values are not recognized

Error CSS max-width Too many values or values are not recognized

И аналогичная ошибка:

  • Error: CSS: max-height: Too many values or values are not recognized

Error CSS max-height Too many values or values are not recognized

В данных случаях для max-width: и max-height: не поддерживается свойство auto. Должно быть конкретное значение в px, % и других единицах измерения для CSS. В целом, эти ошибки не критичные.

  • Error: The for attribute of the label element must refer to a non-hidden form control

Error The for attribute of the label element must refer to a non-hidden form control

Атрибут label должен относиться к фрагменту id с идентификатором «control-label». То есть нужно в код формы вставить кусок id=»control-label». Тоже ошибка не критичная.

id элемент в коде

  • Error: Legacy encoding windows-1251 used. Documents must use UTF-8

Error Legacy encoding windows-1251 used Documents must use UTF-8

Кодировка windows-1251 уже устарела, сейчас везде используется utf-8. По хорошему нужно делать сайт изначально на utf-8, иначе он или отдельные страницы могут отображаться кракозябрами. Но это не критичная ошибка. Если у вас с сайтом все ок, то можно оставить, как есть.

Вот еще похожая ошибка:

  • Error: Bad value text/html; charset=windows-1251 for attribute content on element meta: charset= must be followed by utf-8

Error Bad value text html charset windows-1251 for attribute content on element meta charset must be followed by utf-8

Для атрибута content кодировка должна быть utf-8. Смотрите сами, хотите исправлять это или нет, не критично.

Заключение

После того, как сделана полная проверка, я составляю файл с грубыми ошибками и передаю его моим программистам или технической поддержке клиента. Кстати, почитайте интересную историю, как я искал себе программиста.

Итак, теперь вы знаете, как проверить валидацию сайта с помощью онлайн сервиса W3C HTML Validator, но как я сказал валидность кода далеко не самый важный фактор ранжирования, скорее всего после исправления ошибок вы не заметите существенной разницы в позициях или трафике сайта. Но я считаю, что все равно нужно привести сайт в порядок, и надеюсь, моя статья вам в этом помогла.

0
0
голоса

Рейтинг статьи

<meta itemprop="foundingDate" name="foundingDate" content="2017-12-22" />

The message from the checker is correct. That element isn’t valid. The reason it’s not valid is this:

https://html.spec.whatwg.org/multipage/semantics.html#the-meta-element:attr-meta-name-4

Exactly one of the name, http-equiv, charset, and itemprop attributes must be specified.

The element in the question has both the itemprop and name attributes. So it’s not valid, because the HTML spec says that it must instead have exactly one of them — EITHER the itemprop attribute OR the name attribute. It can’t have both.

<meta itemprop="email" name="contact" property="business:contact_data:email" content="vraagofopmerking@ffsociety.nl" />

That element also isn’t valid — for the same reason that the first element is in the question isn’t valid.

If you want to use the property attribute on that element, then drop the itemprop attribute. Don’t attempt to use both microdata and RDF attributes on the same element.

C

На сайте с 04.02.2005

Offline

274

А Вы пробовали тег не закрыть?

DiAksID

На сайте с 02.08.2008

Offline

218

wawilon:
Как-будто ругается на какой-то определенный символ или что это блин такое?

для начала проверьте «С» и «с» латинские или кириллица. обычная ошибка…

show must go on !!!…

W

На сайте с 12.11.2009

Offline

72

Не закрывать пробовал — ничего не меняется.

Насчет ошибок в С и с — сразу отсек подобное предположение, но для надежности открыл исходник vk.com и скопировать указание кодировки оттуда:

<meta http-equiv=»content-type» content=»text/html; charset=windows-1251″ />

заменив только 1251 на ютф.

Думаю такой подход исключает описки.

А вы попробуйте разобрать ошибки

Line 16, Column 887: Unmappable byte sequence: 81.

<meta http-equiv=»content-type» content=»text/html; charset=utf-8″>



Line 16, Column 1070: Unmappable byte sequence: 81.

<meta http-equiv=»content-type» content=»text/html; charset=utf-8″>

он ругается на 1070 колонку на 16 строке??? Что за хрень? Там нет столько символов.

DiAksID

На сайте с 02.08.2008

Offline

218

wawilon:
… Что за хрень? Там нет столько символов.

посмотрите на исходный код в режиме «без переноса строк». какой-то скрипт/плагин работает: типа убирает лишние пробелы + вытягивает код в одну строку перед рендерингом буфера обмена.

W

На сайте с 12.11.2009

Offline

72

Исходники с переносами строк. Никаких подобных плагинов убирающих пробелы и переносы не стоит.

Еще идеи?

DiAksID

На сайте с 02.08.2008

Offline

218

у вас жеж как бе html5 ? тогда замените этот старый метатег с http-equiv=»content-type» на нормальный для этого стандарта:


<meta charset="utf-8">

1

W

На сайте с 12.11.2009

Offline

72

Заменил как вы сказали — добавилась еще одна ошибка, что мол определение кодировки не стоит в первых 512 байтах. Переместил этот тег выше — теперь выдает 57 ошибок вместо 8-9 как раньше, но исчезла непонятная ошибка с Unmappable byte sequence: 81

Разбираюсь дальше…

DiAksID

На сайте с 02.08.2008

Offline

218

щаз ошибки понятные — старый стандарт для «закрытия» одиночных мета-тегов. надо просто «/>» на «>» поменять там где ругается.

а в путях с гетами, на которые ругается, замените «&» на «&amp;»

1

W

На сайте с 12.11.2009

Offline

72

Он в ошибках подсвечивает «/>», но ругается на другое. Например не пойму почему ругается на верификацию гугл вебмастера:

Attribute name not allowed on element meta at this point.

Сам кусок кода такой:

<meta name=»google-site-verification» content=»hSHCjHXuVggDvKBkL-WvYaMx8teCpmMfYJfEAUqE5Gw» />

DiAksID

На сайте с 02.08.2008

Offline

218

23 января 2013, 07:56

#10

wawilon:
Он в ошибках подсвечивает «/>», но ругается на другое. Например не пойму почему ругается на верификацию гугл вебмастера:

Сам кусок кода такой:

см выше: убиратйе слеш на конце в метатегах, амперсанты меняйте на &amp; в гетах.

сейчас валидит как надо для html5: орёт на старые теги вроде <center> и старые атрибуты. идите по ошибкам и всё будет ок.

с гуглом сделайте нормальную верификацию через залитый в корень файл…

1

Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

tunis dehas

I have an error for my meta name
I put like this
<meta name=»viewport» content=width=»device-width, initial-scale=1.0″>

I checked so many times with the video

Here errors showed by W3C

↑ TOP

Validation Output: 4 Errors

Error Line 11, Column 39: = in an unquoted attribute value. Probable causes: Attributes running together or a URL query string in an unquoted attribute value.
<meta name=»viewport» content=width=»device-width, initial-scale=1.0″>

Error Line 11, Column 40: » in an unquoted attribute value. Probable causes: Attributes running together or a URL query string in an unquoted attribute value.
<meta name=»viewport» content=width=»device-width, initial-scale=1.0″>

Error Line 11, Column 72: » in an unquoted attribute value. Probable causes: Attributes running together or a URL query string in an unquoted attribute value.
<meta name=»viewport» content=width=»device-width, initial-scale=1.0″>

Error Line 11, Column 73: Attribute initial-scale not allowed on element meta at this point.
<meta name=»viewport» content=width=»device-width, initial-scale=1.0″>
Attributes for element meta:
Global attributes
name
http-equiv
content
charset

many many thanks if somebody can help me

5 Answers

Andrei Mondoc November 27, 2014 11:48am

Try this:

<meta name="viewport" content="width=device-width, initial-scale=1">

tunis dehas

Indeed Isaac

here my code

<!DOCTYPE html>
<html>

<head>
<meta charset=»utf-8″>
<title> Tunis D./Web designer </title>
<link rel=»stylesheet» href=»css/normalize.css»>
<link href=’http://fonts.googleapis.com/css?family=Fredericka+the+Great%7CPacifico%7CHomemade+Apple%7CBuda:300′ rel=’stylesheet’ type=’text/css’>
<link rel=’stylesheet’ href=»css/main.css»>
<link rel=»stylesheet» href=»css/responsive.css»>
<meta name=»viewport» content=width=»device-width, initial-scale=1.0″>
</head>
<body>
<header>
<a href=»index.html» id=»logo»>
<h1> Tunis D.</h1>
<h2>Web designer</h2>
</a>
<nav>
<ul>
<li> <a href=»index.html» class=»selected»> Inspiration </a></li>
<li><a href =»projets.html»>Projets </a> </li>
<li><a href=»about.html»>About </a></li>
<li><a href=»contact.html»>Contact </a></li>
</ul>
</nav>
</header>

Andrei Mondoc November 27, 2014 11:26am

Hi Tunis
There are no meta tags in the code you posted so I can’t understand what is going on.
You need to specify them in the <head></head> tag and not in your <header></header> tag which is part of the <body></body> of the html file.
Equally fot the stylesheet link tag, it must be in the «head»:

<html>
      <head>
              <!--- Meta Tags --->
              <link rel="stylesheet" href="css/responsive.css" type="text/css">
      </head>
      <body>
              <header>
                       <a href="index.html" id="logo">
                                <h1> Tunis D.</h1>
                                <h2>Web designer</h2>
                       </a>
                      <nav>
                               <ul>
                                        <li> <a href="index.html" class="selected"> Inspiration </a></li>
                                        <li><a href ="projects.html">Projets </a> </li>
                                        <li><a href="about.html">About </a></li>
                                        <li><a href="contact.html">Contact </a></li>
                               </ul>
                      </nav>
               </header>
      </body>
</html>

tunis dehas

< meta name=»viewport» content=width=»device-width, initial-scale=1.0″ >

tunis dehas

it works
many many thanks

Hello to all,

Sorry for my english, im a spanish guy.

I hace some error when i validate with W3C

I have about 17 error.

Can you help me?

Thank you very much.

Some of errors founded.

  1. error.png Line 1, Column 722Attribute name not allowed on element meta at this point.

    …p,bdsm,vibradores,juguetes eroticos" /><meta name="generator" content="PrestaS…
  1. error.png Line 1, Column 722Element meta is missing one or more of the following attributes: itemprop, property.

    …p,bdsm,vibradores,juguetes eroticos" /><meta name="generator" content="PrestaS…
  2. error.png Line 1, Column 768Attribute name not allowed on element meta at this point.

    …ame="generator" content="PrestaShop" /><meta name="robots" content="index,foll…
  3. error.png Line 1, Column 768Element meta is missing one or more of the following attributes: itemprop, property.

    …ame="generator" content="PrestaShop" /><meta name="robots" content="index,foll…
  4. error.png Line 1, Column 813Attribute name not allowed on element meta at this point.

    …name="robots" content="index,follow" /><meta name="viewport" content="width=de…

Понравилась статья? Поделить с друзьями:
  • Error attempt to read or write outside of partition entering rescue mode
  • Error attempt to read or write outside of disk hd0 entering rescue mode
  • Error attempt to read or write outside of disk cd0
  • Error attempt to apply non function
  • Error attaching to ose error 0x00000000 office 2010