Re: A problem w/PRE element

 Jordan Reiter <jreiter@mail.slc.edu>



>I was validating a page using the Kindler, Gentler Validator (DOCTYPE HTML
>4.0) and was told that my use of the PRE element was incorrect because
>   : document type does not allow element "PRE" here; missing one of
>   : "OBJECT", "IFRAME", "BUTTON" start-tag
>I looked through the docs and found no reference to PRE being required to
>be within OBJECT, IFRAME or BUTTON elements.  What is wrong here?

><P ALIGN=CENTER><SMALL><PRE>
>foo
>   foo
>      foo
></PRE></SMALL></P>

The above doesn't validate as PRE (block) is not allowed in SMALL (inline)

OBJECT, IFRAME, BUTTON are all inline elements and as such allowed in SMALL.
All three, however, can contain blocklevel elements:

<!ELEMENT IFRAME - - (%block;)+ -- inline subwindow -->
<!ELEMENT OBJECT - - (PARAM | %inline; | %blocklevel;)* -- generic embedded
object -->
<!ELEMENT BUTTON - -     (%inline; | %blocklevel;)+ -(A | %formctrl; | FORM
| ISINDEX | FIELDSET)     -- push button -->

Therefore (e.g.)
<P ALIGN=CENTER><SMALL><IFRAME><PRE>
foo</PRE></IFRAME></SMALL></P>
is valid

/e

Received on Monday, 22 September 1997 02:41:07 UTC