W3C HTML5 validator error: An body start tag seen but an element of the same type was already open

StackOverflow https://stackoverflow.com/questions/17559756

  •  02-06-2022
  •  | 
  •  

문제

I post this question because I'm having some errors with the w3c validator in my page (Link to validation).

It outputs me a lot of strange errors related with my HTML 5 markup, being this the main error I can't get out of my head:

Line 15, Column 6: An body start tag seen but an element of the same type was already open

I have looked a lot into this problem and I'm not able to find any solutions.

Although there are more strange errors, such as

Line 14, Column 7: Stray end tag head

I'm specially interested in the first exposed one, which I would like you to help me solving this.

Thanks in advance!

Problem solved:
Conclusions:

  1. Never display data into the <head> tag, otherwise, a body tag will be automatically opened.
  2. The <noscript> tag content is considered by the validator as displayable, so It's convenient to take care of what we write into the tag.
도움이 되었습니까?

해결책

The noscript element in the head element contains text output. This is not allowed in the head element; noscript in the head element may contain only link, style, and meta elements (see the spec). Any displayable content implicitly closes the head element and opens the body element (because of their content models and the fact that both opening and closing tags for them are optional).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top