faqts : Computers : Internet : Web : XML

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

11 of 12 people (92%) answered Yes
Recently 8 of 9 people (89%) answered Yes

Entry

What is the deal with empty tags looking like <br/>?
What is the deal with empty tags looking like <br/>?
What is the deal with empty tags looking like <br/>?

Nov 21st, 2000 07:05
Michael Claßen, Ben Gordon,


The line break <br> in HTML is defined as an "empty" tag, meaning it
cannot hold text or other elements inside. One of the simplifications of
XML in regards to HTML and SGML is that documents need to be
well-formed, i.e. opening and closing tags have to be properly nested
and cannot be ommitted. Therefore in XHTML <br> needs to be written as
<br></br> or <br/>, the latter explicitly denoting an empty element.
Most Web browsers can cope with that notation, especially when a space
is inserted like this: <br />