Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are <hr> and <br> inline or block elements?

Tags:

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

like image 313
Svish Avatar asked Sep 02 '09 18:09

Svish


2 Answers

<hr> is a block level element whereas <br> is an inline level element.

Additional reference:

  • The HTML5 specification for <hr> by the W3C
  • The HTML5 specification for <br> by the W3C
like image 191
Sampson Avatar answered Sep 24 '22 01:09

Sampson


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.

like image 27
Gumbo Avatar answered Sep 22 '22 01:09

Gumbo