View Full Version : <blockquote> not valid?


Monkey Bizzle
05-03-2005, 08:56 PM
I use the <blockquote> tag to quote people so that you can differentiate between that and regular text. Well, occasionally I validate my site to make sure it's still valid and the <blockquote> tag won't validate! This is the error that I get:

Line 656, column 11: document type does not allow element "blockquote" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

<blockquote>

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


I made that part red because on the w3schools website it says:


The <blockquote> tag is supposed to contain only block-level elements within it, and not just plain text.

To validate the page as strict XHTML, you must add a block-level element around the text within the <blockquote> tag, like this:

<blockquote>
<p>here is a long quotation here is a long quotation</p>
</blockquote>


so I did that... but I guess that didn't work... initially I had no tags in there and just text and that didn't validate either. How can I use the <blockquote> tag and still have a valid site?

pb&j
05-04-2005, 07:06 AM
strict can be rather finiky.

this seems to validate...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<title>
test
</title>
</head>

<body>

<blockquote>
blah blah blah
<p> same here more blah stuff</p>
</blockquote>

</body>

</html>

Monkey Bizzle
05-04-2005, 07:12 AM
strict can be rather finiky.
i don't use strict... i use exactly what you posted...

MaGiCSuN
05-04-2005, 07:35 AM
have you also tried:

<blockquote>
blah blah blah
<p> same here more blah stuff</p>
</blockquote>


the text before the <p> tag ... ?
if you did, forget this reply :) i can't check site's at the moment since i'm at work haha

Love,
Mirna

Monkey Bizzle
05-04-2005, 08:42 AM
have you also tried...
i haven't tried it but I don't think I will because then I will have 2 paragraphs in my blockquote and it's only supposed to be one =/

kittycat
05-04-2005, 08:49 PM
It's because you have it included inside a <span> section I think. If you can change the span to a div it should work.

Monkey Bizzle
05-04-2005, 09:44 PM
YES! That's what it was! I forgot that I put that entry in a span tag so people could read it better LOL! Thanks kittycat!