...

View Full Version : easy W3C Validation question



Subcitizen
11-20-2008, 04:31 AM
Hi. Thanks for looking at my post. I'm in the process of validating the html on my WP blog using W3C validation. I'm receiving this error:


document type does not allow element "p" here; missing one of "object", "ins", "del", "map", "button" start-tag .

Now, the validator provides a link in the "source listing" portion of the page and the code and/or text that I see in the source listing does not reside in my local files. At least, I don't think it does cause I can't find it using search terms such as "Anyone", "thousands", "people", "worldwide", etc.

This is text/code that the validator is pointing to that is causing the error.


<p>Hey, Anyone out there want to be seen by thousands of people worldwide? We

I imputed this as part of a post using the admin at WP, so they're not in my local files (I don't think). I don't need to find that text necessarily, just edit the <p> tag before it. How can I find that particular <p> tag so I can edit it?

Also, here's a link to my blog, so you can see for yourself. It's the first error.

http://www.subcitizen.com/blog/

Thanks so much for your time!!

Jason

_Aerospace_Eng_
11-20-2008, 04:42 AM
Go into your wordpress admin area and edit the post. You'll have to edit the html source directly. Click on the HTML tab in the wordpress editor for that post.

Subcitizen
11-20-2008, 05:14 AM
Thanks for your help, _Aerospace_Eng_! I can't seem to find the html tab in WP admin. Here's a picture of the wordpress editor:





http://www.subcitizen.com/images/Picture-20.gif





I can edit the post, but not the html.

Am I in the right place?

Thanks,
Jason

_Aerospace_Eng_
11-20-2008, 05:15 AM
Click on the View link on the right. I think that will allow you to switch back and forth. Your version of WP is outdated by the way. How long ago did you install it?

Subcitizen
11-20-2008, 05:25 AM
"View" takes you to the actual post on the web page.

I think I installed it, maybe six months ago.

There's another tab you can see, called "files". That's where you can edit the code. However, I think that's the same code that's on my local files. So, I still won't be able to find the "<p>".

I think when you create a post in WP. The text that you enter is saved to a database. So, there's no one file where you'll find the code of the page, and the written text of the post. How do I find the line of code that the validator told me to change?

Thanks Again,
Jason

_Aerospace_Eng_
11-20-2008, 05:27 AM
Looks like you'll have to go into the database and find that post to change it. You could try updating wordpress so you get the option to edit the html. I don't think it will mess up your layout. It may or may not.

Subcitizen
11-20-2008, 05:33 AM
If you remember, I don't actually want to change the post itself, just the code before it. But I can't find the code before it (the <p>) because it's too generic. The W3C validator shows this as the error in question


<p>Hey, Anyone out there want to be seen by thousands of people worldwide? We

with the "<p>" as causing the problems. How do I find that <p> if whenever I do a search for "Anyone", "thousands", "People" nothing shows up?

Thanks Again _Aerospace_Eng_,

Jason

_Aerospace_Eng_
11-20-2008, 05:36 AM
Sighs. The post is likely saved with multiple paragraph tags but you can't see this because you don't get to see the html. The html IS stored in the database which is why I said to look in the database. Quite searching for those terms. You aren't going to find them using Dreamweaver. You'll to go into your mysql database to find the post and delete the extra paragraph tags.

Subcitizen
11-20-2008, 05:43 AM
Thanks so much!! I think that's it. That's where I need to look. Hopefully, I can make the correct changes now. The validator mentioned:


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>").

So, I'll just find the <p> and delete it, and see what happens.

Thanks again for your help. I really think you pointed me in the right direction!!!

Thanks,

Jason

tomws
11-20-2008, 06:07 AM
For what it's worth, the opening para tag doesn't appear to be a stray. Viewing source and stripping all content yields this structure for the cell:

<td>
<p>
<p></p>
<p class="a2a_link"></p>
</p>
</td> Firebug doesn't match the tags up like that, though. But I came up with the same structure after stripping it twice (maybe too sleepy to be doing that!).

Now, regarding the actual error, I had the same error a few days ago for putting a ul inside a para under xhtml 1.0 strict. For some reason, the validator considered the para to be an unacceptable block level container for the ul (don't know why). Moving it outside the para worked.

It may also be doing something similar with you. The td may be flagged as an inline object for the purposes of validating contained block level elements, which it considers the para to be. I'm more inclined to believe that since, if you'll look at the source tree on up from there, you see those tables are nested within divs inside table cells rather than directly within the cells themselves, and the error specifically mentions tables (with paras) as one of the block level elements that should not be a child of an inline element. The template designer worked around the error by using the divs.

In the end, though, I guess that's all no help for trying to get your page to validate. I'd bet on it being the text editor's fault as it may be saving the contents to the db in para tags. Some WP user may be able to confirm/deny that.

_Aerospace_Eng_
11-21-2008, 04:22 AM
For what it's worth, the opening para tag doesn't appear to be a stray. Viewing source and stripping all content yields this structure for the cell:

<td>
<p>
<p></p>
<p class="a2a_link"></p>
</p>
</td> Firebug doesn't match the tags up like that, though. But I came up with the same structure after stripping it twice (maybe too sleepy to be doing that!).

Now, regarding the actual error, I had the same error a few days ago for putting a ul inside a para under xhtml 1.0 strict. For some reason, the validator considered the para to be an unacceptable block level container for the ul (don't know why). Moving it outside the para worked.
You can't have a paragraph within a paragraph. The only things allowed within a paragraph are inline elements such as a span, anchor, or image.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum