PDA

View Full Version : What's up with the validator?


Absolitude
March 26th, 2007, 09:37 PM
I am making a website, and i want it to be xhtml strict 1.0 Everything is going fine until i validate the "about.html" page. For some reason the w3c checker says:

"The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element. One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>")."

Do you know what this means? I think it is that i have incorrectly nested my <h2> inside my <p>. But how can this be? I have gone over my code 37 times, and it is in perfect order. And this happens every time i do that. Can you please tell me what's going on?

Virtual Headache
March 26th, 2007, 09:50 PM
Can you post the whole line which is causing the error?

Absolitude
March 26th, 2007, 09:59 PM
Now it has. Here are the lines: <p><h2>Bkue:</h2> Thanks for being such a noob, and making me understand that <p><h2>Twilly:</h2>Thanks for being supportive of me, and not doing anything <p><h2>Kikyo:</h2>You get mad at very little, and hate American boys like me. <p><h2>Me:</h2>Thanks for not being so lazy, and getting off your bed to go m

Don't criticize me about my personal comments.

Tyler
March 26th, 2007, 10:10 PM
Close your paragraph tag </p>

Virtual Headache
March 26th, 2007, 10:11 PM
Put the headline outside of the <p> tags.
You also need to close the <p> tags.

Absolitude
March 26th, 2007, 10:14 PM
I did, here is the whole pages code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>About Absol</title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
</head>

<body>

<div id="wrapper">

<div id="header">
<h1></h1>
</div>

<div id="menu">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About absol</a></li>
<li><a href="#">Link Three</a></li>
<li><a href="#">Link Four</a></li>
<li><a href="#">Link Five</a></li>
</ul>
</div>

<div id="sidebar">

<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About absol</a></li>
<li><a href="#">Link Three</a></li>
<li><a href="#">Link Four</a></li>
<li><a href="#">Link Five</a></li>
</ul>
<div id="sidebar-bottom">
&nbsp;
</div>
</div>

<div id="content">
<div class="entry">
<div class="entry-title">Text text text</div>
<div class="date">Posted on 26 March 2007</div>
<p>Text text text</p>
<p><h2>Bkue:</h2> text text text.</p>
<p><h2>Twilly:</h2>text text text</p>
<p><h2>Kikyo:</h2>text text text</p>
<p><h2>Me:</h2>text text text</p>
</div>
</div>

<div id="footer">
<div id="footer-valid">
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a>&copy; 2007-2008 Absol. All rights reserved.
</div>
</div>

</div>

</body>
</html>

Eon-Rider
March 30th, 2007, 08:15 AM
You never put <h1>, <h2>, <h3> etc. within a paragraph (<p>).

Geometric-sama
April 2nd, 2007, 03:49 PM
Headline tags <h1>, <h2> etc, are block-level elements, as are <p>. Don't nest 'em~