W3C home > Mailing lists > Public > www-html@w3.org > April 2002

XHTML DTD Question: span and p

From: Greg Faron <gfaron@integretechpub.com>
Date: Mon, 15 Apr 2002 16:24:59 -0400 (EDT)
Message-Id: <>
To: www-html@w3.org

Hello all,

   I'm trying to write valid xhtml documents in which I have span elements 
whose data I rewrite and whose visibility I modify.  In the course of 
authoring and validating it became painfully obvious that, according to the 
XHTML Transitional DTD, a <span> element may not contain a <p> element (or 
a <div> for that matter).  I was wondering if this is an oversight or, if 
not, what reason would there be to design it this way?

   I have the following snippet of XHTML that I'm trying to validate, but 
of course it complains about the <p>...</p> tag inside of the "span_page1" 
span element.

<table align="center" border="0" cellpadding="0" cellspacing="0" width="90%">
       <span id="span_page1" style="display:inline;">
Please enter the Mathematical equation that will serve as the
basis for this style of question.  Remember that each equation
basis can create a great number of actual problems, depending
on random number generation and restrictions.
         <span id="span_basis" style="display:none;">
           <object id="question" width="500" height="100" 
             <param name="DataType" value="1"/>
             <param name="Data" value=""/>
             <param name="AutoSize" value="true"/>
           <br clear="all"/>
           <span id="span_basis_mathml" style="display:inline;">
             <!-- -->
         <div align="center">
           <input type="button" value="Enter Equation" 
           <input type="button" value="Next" onclick="prepSubmit(1);"/>
       <span id="span_page2" style="display:none;">
Page 2 (Incomplete)
         <div align="center">
           <input type="button" value="Back" onclick="presentPage(1);"/>
           <input type="button" value="..." onclick="javascript:;"/>
           <input type="button" value="Next" onclick="prepSubmit(1);"/>

   I need the external-most span element to enable/disable the entire cell 
contents, but it seems that I should be able to space paragraphs out within 
that span, rather than using two consecutive <br /> tags to simulate such a 
break.  Also, it's nice to be able to wrap my text block in its own tag for 
my editor (XML Spy) to indent it properly.

   Any thoughts or replies?

Greg Faron
Integre Technical Publishing Co.
Received on Thursday, 18 April 2002 13:54:41 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:59 UTC