• Register
0 votes
260 views

Problem :

I am beginner to html. I have recently started learning html. When I tried to process my web page in a W3C validator it started showing me below error

“Start tag head seen but an element of the same type was already open”.

But when I try to remove the start tag of <head>,it passes. If I re add a start tag then the error comes back again. How can I fix this issue? Can anybody help me in fixing this issue?

2.3k points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I have gone through your question. I found it interesting so I am trying to help you.

Your error "Start tag head seen but an element of the same type was already open." Usually occurs as a start tag for a head element is the optional.

As any style element can only exist within a head tag so usually a parser will know to open a head element when it sees a <style> tag, as inserting the invisible <head> start tag.
No error or warning will be thrown there  as I already told you that your <head> start tag is the optional.
But if a parser sees your <head> start tag then it will certainly throw the error as your head was already in open state.

5k points