homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

Why won't this validate?
HTML validation question

 9:24 pm on Dec 1, 2010 (gmt 0)

I am working with an old site and trying to clean it up before we do any more modifications. When I first took over, there was no doctype, so I started just trying to validate to a specific doctype. There is something in the head section that is making the validator trip up on the body tag. It keeps telling me that it doesn't belong there. I tried two different validators with the same result.

The entire section before that is included here. I cannot see anything there is that not a valid head section, with a proper closing tag.

Thanks for any help!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<title>HOMER Energy - Hybrid Renewable and Distributed Power Design Support</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="google-site-verification" content="ypNUWG7sGr8oNL5V6A5OZsCsftVPbc2K3-e1PjhvLVg">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link href="styles/main.css" rel="stylesheet" type="text/css">
<style type="text/css">
background-color: #FFF;
background-color: #FFF;
.rightcol {
.rightcol li {
list-style-image: url(../images/arrow_blksm.gif);
text-align: left;
font-size: 11px;
<script src="javascript/testimonials.js" type="text/javascript"></script>
<script type="text/javascript" src="javascript/global.js"></script>
<script language="javascript" type="text/javascript">
function loginInput()
var login = window.loginFrame.document.loginForm.username.value;
var password = window.loginFrame.document.loginForm.password.value;

document.hiddenLoginForm.username.value = login;
document.hiddenLoginForm.password.value = password;




 9:43 pm on Dec 1, 2010 (gmt 0)

it's the Doctype, if that was a frameset document it would not have anything else (e.g. scripts) in it

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

instead of:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

PS: my manners are atrocious! sorry.. Welcome to WebmasterWorld marilyndwalker

[edited by: SuzyUK at 9:47 pm (utc) on Dec 1, 2010]


 9:44 pm on Dec 1, 2010 (gmt 0)

The problem is that you have specified a Frameset DOCTYPE, and Framesets do not contain a body element.

You should probably use either an HTML5 doctype:

<!DOCTYPE html>

HTML 4.01 Strict doctype:


or HTML 4.01 Transitional doctype:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"


 9:51 pm on Dec 1, 2010 (gmt 0)

OK thanks. There is an inline frame later in the document, but I take it that the frameset spec is not necessary for that? I haven't used frames much.


 9:52 pm on Dec 1, 2010 (gmt 0)

Welcome to WebmasterWorld marilyndwalker ;), and good on you for cleaning up first.

To add to the above advice: If you really do have frames you need to use the doctype you already have, but use <frameset> rather than <body>.

The recommendation [w3.org] has an example document. Even if you aren't using frames you may find it interesting because it makes it really esy to see why your document was failing validation.


 10:03 pm on Dec 1, 2010 (gmt 0)

There is an inline frame later in the document, but I take it that the frameset spec is not necessary for that?

That is correct. The frameset DTD only applies to the actual <frame> attribute.

In fact, in HTML 5, the <iframe> element will still be supported, but not the <frame> element. Reference [w3schools.com]

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved