Reply to Re: Keeping the formatting of text

Your name:

Reply:


Posted by Jim Carlock on 08/06/06 04:12

>>Or use nl2br($text) to convert line breaks to <br>.
>
>That converts line breaks to <br /> which doesn't validate as
>HTML unless you do str_replace("<br />", "<br>", nl2br($text));

"Tim Roberts" <timr@probo.com> wrote:
> Interesting. I hadn't realized that form wasn't in the HTML standard.
> Every browser in the world will accept <br/>, and it is required for
> XHTML.

Do you know if the extra space in the <br /> was required at one time?
I just tested a page with <br/> and it validated as XHTML Transitional,
XHTML Strict, and HTML Strict and and it doesn't seem to be required.
For some reason though, I've always put that extra space in. I'm now
wondering why I put it in there...

HTML Strict doesn't validate the <meta /> tags in the header and requires
the meta tags configured as follows:

<meta name="description" content="test">

However, the closed /> tags validate (<br /> and <img />) when they're
in the body (HTML 4.0 Strict).

--
Jim Carlock
Post replies to the group.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация