Reputation: 443
I was hoping that someone may know how to resolve this HTML5 validation error. When I try to validate my page: http://blog.genesispetaluma.com using http://validator.w3.org, it gives me the following error code:
Error Line 90, Column 63: An body start tag seen but an element of the same type was already open.
<body class="home blog single-author two-column right-sidebar">
I interpreted this error to mean that I have two body tags in the code. However, I have searched everywhere and can only find one <body>
(the one referenced by the error) and one </body>
. Can anyone please tell me how to resolve this error?
Upvotes: 26
Views: 102300
Reputation: 141
This happens also when there is div inside <head></head>
section. Considerate <div>
like a <body>
Upvotes: 0
Reputation: 51
This error can happen if you put into <head>
tag that restricted to be there. For example:
<head>
<audio preload="auto" class="menu-beep" id="sound-01">
<source src="sound-01.mp3">
</audio>
</head>
In this case, the tag will be immediately opened in the browser memory. But later the browser will find the body tag that opens the page. This is how it turns out that there is a second body tag.
Upvotes: 0
Reputation: 1578
Also bear in mind, if you copy/paste your code from things like slack, etc. they will have 'special characters' for formatting (that are usually invisible) which may cause that issue.
Here is a video to demonstrate: https://drive.google.com/file/d/1OJS15zmSvzhVXVLcQGGhePZGNCxWHocN/view
Upvotes: 0
Reputation: 275
In my case it was the facebook tag
<div id="fb-root"></div>
which was inside the page's <head>
.
Moved that to the <body>
of the relevant page (not required globally) sorted it. So yes, the answer supplied above by Emil H was correct.
Upvotes: 0
Reputation: 4955
It happens in below said scenarios as per my knowledge -
<head>
thinking <header>
tag.<header>
, <nav>
, <section>
or <footer>
tag(s) are outside of <body>
tag.So, after creating your page, you can validate these changes here.
Upvotes: 1
Reputation: 1
If Your problem With head and body both are show validate error just remove displaying text from head and keep it in body.. I have been faces the problem recently. For Example You have text to display in header inside head just remove header from head and keep it in body ......Problem solved...Thanks
Upvotes: 0
Reputation: 579
Just for the record, I had exactly the same problem and it seems that including some php files within the head element was strangely giving the problem, even if the view-source of Firefox was not printing such php code nor tags
<head>
<? include("./file.php"); ?>
<title><? echo $title ?></title>
</head>
solved using:
<? include("./file.php"); ?>
<!DOCTYPE html>
<html>
<head>
<title><? echo $title ?></title>
</head>
<body>
...
...
Upvotes: 0
Reputation: 8598
I had similar problem with <head>
tag. I use https://validator.w3.org
Look at few examples how to solve this problem:
<script>
should be inside <head>
<head>
Upvotes: -2
Reputation: 19713
I had a similar problem but with <head>
, giving the following W3C markup error:
A head start tag seen but an element of the same type was already open
I had this code:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<head>
When it was supposed to be:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
I knew that was wrong but it's hard to spot sometimes, as you're just so used to the header code being correct 99% of the time. I obviously cut n pasted some code and that ended up in the wrong place.
This isn't specific to your question, I know, as your error relates to the <body>
tag, but this is the kind of thing you're looking for. Maybe you have a <link>
or <meta>
tag in your body somewhere, that's meant to be in the <head>
. Without seeing your code, it's hard to give you a perfect answer.
Upvotes: 14
Reputation: 9
I got the same error message : check out if any body-inside <element>
is displayed between the <head>
and <body>
, like said above.
My error was caused by a <div>
tag, with absolute position, to display some page information during the development - simply a line on a false position in the code.
Upvotes: 0
Reputation: 31
I got this error:
A head start tag seen but an element of the same type was already open
I read this post and then i noticed my tag listed before the head like this.
<title>Home</title>
<head>
</head>
it should have been
<head>
<title>Home</title>
</head>
Upvotes: 1
Reputation: 1084
One of the widgets (the facebook like button I believe) you're using is inserting HTML into the page and part of that HTML is a body tag. Not sure if there's anything you can do about this, but I think that's what's throwing the error. Looks like this:
<body class="plugin transparent_widget ff4 win Locale_en_US">
</html>
</iframe>
Upvotes: 2
Reputation: 21081
Possibly it's because:
<div id="wrapFix">
<div id="drawLogo1">
<div id="drawLogo2">
<img src="http://genesispetaluma.com/img/logoNew.png" alt="Genesis Fitness G stylelogo">
</div>
</div> <!-- end of drawLogo1 -->
Is between your closing head tag and opening body tag. I.e. lines 81-87
Upvotes: 11