cjvannette
Member
Posted 1 year ago #
The W3C validator gives me this spectacularly unhelpful error:
document type does not allow element "h3" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag
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 "", "<span>", or "<font>").
The mentioned element is an h3 tag. And I get the same error for p's. As far as I can tell, there aren't any open inline elements before this. Any ideas?
the validator is alway right ;-)
without seeing the corresponding html code, nobody can even try to comment on this or try to explain why this is not valid.
cjvannette
Member
Posted 1 year ago #
Gotcha. Okay, here's the body:
[please use a Pastebin to post large chunks of code, following forum etiquette]
Much easier for people to help if you post a link to the page in question.
cjvannette
Member
Posted 1 year ago #
http://www.gorillamarketing.net
Didn't realize I should use a Pastebin for the code, sorry. http://pastebin.com/GDat5882
I ran the validator on that page and though I do see 23 errors reported (many relating to paragraph tags) I don't see any about h3 tags, or any other headings. Is the homepage where you were seeing that validation error? If not, could you provide the specific URL of the page in question? Thanks.
cjvannette
Member
Posted 1 year ago #
Yes, it was on the homepage, but now I also see that most of the errors are gone. Apparently the WordPress elves came along and fixed it. :P It is still hollering at me about p's in the footer, though.
I see this throughout your code:
<p />
I've never seen that before - that may be causing some of the issues.
Paragraphs normally go in these tags:
<p>Your paragraph here</p>
Were you mixing it up with a self-closing line break, perhaps?
<br />
cjvannette
Member
Posted 1 year ago #
Oh, I though you could self-close p tags!
Oh, I though you could self-close p tags!
Nope, not as far as I know. Think of it this way - the browser needs to know where the paragraph ends - it's not psychic. ;-)
cjvannette
Member
Posted 1 year ago #
I think it might be mis-stated. XML may support <p /> but not XHTML - which is the doctype your site is using - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
"Given an empty instance of an element whose content model is not EMPTY (for example, an empty title or paragraph) do not use the minimized form (e.g. use <p> </p> and not <p />)."
References:
http://www.neowin.net/forum/topic/875818-html-401-xhtml-10-xhtml-11-html-5/page__st__15
http://www.w3.org/TR/xhtml1/#C_3
cjvannette
Member
Posted 1 year ago #
Okay, thanks. I'm still having issues, but this is making progress. I have no illusions about getting down to zero validation errors, but damn, I'd like to get down to single digits, if only so my SEO guy will get off my back. :)
Tip for solving validation errors - I find it easiest to do by checking off the "Show Source" option - that lets you click a link to the left of each error, which brings you directly to the offending bit of code in your source. Good luck - I know this is a tedious process!
cjvannette
Member
Posted 1 year ago #
Well, the chief problem is, I'm a beginner trying to do intermediate things. But the CSS and PHP books are on their way to me right now!