...

View Full Version : Correctly Nested but Validator having Fit, Please help



wolfcry044
01-26-2007, 01:00 PM
I ran this chunk of code through the validator, and it keeps comming up with an error. I don't see how it could be, as the DIV's are nested correctly as far as I can tell.

Can anyone tell me why the validator is having a fit with this? Thanks.


<!-- BEGINS SIDEBOX -->
<div class="sideboxbackground">

<!-- SideBox Header -->
<div class="sidebarheaderbar">
<div class="sidebarheadertext">
Defcon LVL
</div><!-- End Sidebox Header Text -->
</div><!-- End Sidebox Header Bar -->

<!-- Side Box Content -->
<div class="sidebartext">
<br>
<IMG SRC="http://www.uafclan.com/main/assets/defcon5.gif" ALT="We are currently at Defcon 5">
</div><!-- End Sidebartext -->
<br>
</div><!-- END Sideboxbackground -->

<!-- END SIDEBOX -->

_Aerospace_Eng_
01-26-2007, 06:15 PM
For the validator to validate direct input it the code needs to have a doctype. If you had read what the validator told you to do before you validated you would have known this. Try this instead.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<!-- BEGINS SIDEBOX -->
<div class="sideboxbackground">
<!-- SideBox Header -->
<div class="sidebarheaderbar">
<div class="sidebarheadertext"> Defcon LVL </div>
<!-- End Sidebox Header Text -->
</div>
<!-- End Sidebox Header Bar -->
<!-- Side Box Content -->
<div class="sidebartext"> <br>
<IMG SRC="http://www.uafclan.com/main/assets/defcon5.gif" ALT="We are currently at Defcon 5"> </div>
<!-- End Sidebartext -->
<br>
</div>
<!-- END Sideboxbackground -->
<!-- END SIDEBOX -->
</body>
</html>

It validates.

wolfcry044
01-26-2007, 11:12 PM
Oh, I did put a doctype in, but I didn't think the proper HTML structure was needed to validate.

Thank you very much! It's highly appreciated.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum