For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > September 2004 > Re: CGI.pm : Handling Carriage Returns from textarea()









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: CGI.pm : Handling Carriage Returns from textarea()
Chris Devers

2004-09-12, 8:55 pm

On Thu, 9 Sep 2004, Robert Page IV wrote:

> I am familiar with <br>. What is the difference between <br> and <br />?


It's an XHTML / XML -ism.

In strict XML markup -- of which XHTML is one example -- all tags have
to be balanced. For HTML, this means that tags that it used to be okay
to leave unbalanced -- <p> paragraphs with no closing </p>, etc -- all
now need to have that closing tag.

For singleton tags like <br>, <hr> and <img>, the rule still applies, so
that in theory you're supposed to be write <br></br>, <img ...></img>,
etc.

Because this is really annoying, XML allows a special case where tags
that do not contain any content -- that is, <br></br> -- can simply be
abbreviated to <br />, and the "/>" implies the closing tag.

If you're still writing pre-XHTML web page markup, it doesn't really
matter, but it's a good habit to develop, as eventually HTML as it has
been sloppily used for a decade now is going to be phased out. (Well ok
probably not phased out, but new tools will eventually stop supporting
it, so you'll have to use old browswers (etc) to view old documents.)



--
Chris Devers
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com