5 replies [Last post]
sionvalais
Offline
Regular
Last seen: 16 years 27 weeks ago
Joined: 2003-06-06
Posts: 49
Points: 0

Is there any?

KnightWolfJK
KnightWolfJK's picture
Offline
Enthusiast
Washington, DC
Last seen: 12 years 25 weeks ago
Washington, DC
Timezone: GMT-5
Joined: 2003-06-10
Posts: 210
Points: 0

difference between <br> and <br />

Visually speaking, there's no difference. But if you want valid XHTML, the <br /> is required per spec. I just learned that the night before last myself.

Same applies for other items like <link rel=...>, <hr>, and <img...> tags- they should all be escaped with a />.

I looked for a full list of deprecated tags and couldn't locate the one I was looking for, but I'm sure it's out there...

Diplomacy is the art of letting someone have your way

sionvalais
Offline
Regular
Last seen: 16 years 27 weeks ago
Joined: 2003-06-06
Posts: 49
Points: 0

Compatibility

Does this work with browsers?

paCkeTroUTer
paCkeTroUTer's picture
Offline
Enthusiast
Melbourne, Australia
Last seen: 6 years 30 weeks ago
Melbourne, Australia
Timezone: GMT+10
Joined: 2003-06-27
Posts: 241
Points: 2

difference between &lt;br&gt; and &lt;br /&gt;

Everything works with browsers.... it all depends on how perfect you want your website to be and how accessable you want it to be.

http//melbourne.ug.php.net

dJomp
dJomp's picture
Offline
Enthusiast
Last seen: 3 years 45 weeks ago
Joined: 2003-03-23
Posts: 422
Points: 0

difference between &lt;br&gt; and &lt;br /&gt;

HTML uses <br>.

XHTML is HTML 'translated' into XML format, which requires all tags to be closed. For every <p>, there must be a </p>, etc. Normal XML single tags are of the format <star/> (note no space).

Now most browsers that are used to HTML will choke on <br></br> or <br/>, so some clever person realised that <br /> works. It's valid XML (XHTML), and HTML parsers will accept it.

So for HTML ignore the slash, for XHTML include the slash but make sure you include the space.

You know you're a geek when you try to shoo a fly away from the monitor with your cursor.

Damien
Offline
Regular
Adelaide, South Australia
Last seen: 16 years 14 weeks ago
Adelaide, South Australia
Joined: 2003-09-05
Posts: 16
Points: 0

difference between &lt;br&gt; and &lt;br /&gt;

Sionvalais, if you are interested, I wrote an XHTML Article recently. You may want to give it a quick look. It will explain everything you need to know about XHTML is a short time. Mirrored here.