W3C home > Mailing lists > Public > www-amaya@w3.org > October to December 1999

Re: display problem with HR inside H2

From: <Bertrand.Ibrahim@cui.unige.ch>
Date: Wed, 08 Dec 1999 20:54:39 +0100
To: Adam Ambrose <Adam_Ambrose@geoworks.com>
Cc: www-amaya@w3.org
Message-id: <0FMF006JMTZ4SX@cuimail.unige.ch>
Adam_Ambrose@geoworks.com said:
> When the <HR> tag is inside a <H2> tag ...

This is not valid HTML. If you look at the DTD, you will see that an H2 
element can only have an "inline" content, while the HR element is a
block element and can thus not be included where only inline content is
allowed. The appropriate portions of the HTML 4 DTD are:

<!ENTITY % heading "H1|H2|H3|H4|H5|H6">
<!ELEMENT (%heading;)  - - (%inline;)* -- heading -->

<!ENTITY % block
  "P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
  BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">

The first two lines say that headings H1 to H6 can only have inline content
and the rest says that HR (like some other elements) is a block element.

Note: I had asked this same question some time ago and it is Vincent Quint
who pointed out my mistake.

Peace,

Bertrand Ibrahim.
--------------------------------------------
Bertrand.Ibrahim@cui.unige.ch
http://cuiwww.unige.ch/eao/www/Bertrand.html
Received on Wednesday, 8 December 1999 14:54:51 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:53:21 UTC