views:

542

answers:

4

My guess is that <br> might be inline and that <hr> might be block. But I don't really have a clue...

+7  A: 

<hr/> is block. And <br/> is inline.

Jonathan Sampson
Hm, didn't understand that last part...
Svish
The support for <br style="clear:left;" /> is removed. It is intended to break, and nothing else :)
Jonathan Sampson
Aha. So should put that clear on something else then?
Svish
No, don't use a clear. It defeats the purpose of using the <br/> :)
Jonathan Sampson
Huh? I was meaning that if using clear, it should be used on something else than `<br>`. Cause clear is still supported on other elements I hope? Related to float, etc...
Svish
The support for clearing hasn't been "removed" -- what are you talking about? It doesn't need to be attached to a br tag, but it's a vital part of the toolkit when there are floated elements.
AmbroseChapel
@Johnathan Sampson: You should read the specifications more carefully: Only the `clear` attribute has been deprecated in HTML 4 in favor of CSS.
Gumbo
+1  A: 

The HR element is defined to be element of block. It’s also being displayed in its own line like any other block element. Thus HR is a block element.

The BR element is defined to be element of special and that is defined to be inline. It’s also not being displayed in its own like like a block element, but just creating a line break. Thus BR is an inline element.

Gumbo
A: 

BR is an inline element, and has been deprecated in XHTML 2 in favor of LINE. (All academic at this point, of course...)

HR was a block element, but was deprecated in HTML 4.01 and is not part of the XHTML 1.0 Strict DTD.

richardtallent
HR is part of strict...
Daniel A. White
-1 The current working draft of XHTML 2 has no `line` element, `HR` is not deprecated in HTML 4.01 and is also part of XHTML 1.0 Strict!
Gumbo
I stand corrected... that's what I get for double-checking something other than the actual DTDs.
richardtallent
+1  A: 

According to the HTML 4.0 Strict DTD:

<HR /> is a block-level element and <BR /> is an inline element.

All the block-level elements are defined in the DTD thus:

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


<!ENTITY % heading "H1|H2|H3|H4|H5|H6">

<!ENTITY % list "UL | OL">

<!ENTITY % preformatted "PRE">

The rest are inline by default. Of course, a BR does force a line-break so acts similar to a block level element, but that doesn't mean it is.

Dan Diplo