Re: <br> was [PHP] Re: render html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sep 22, 2008, at 9:24 AM, tedd wrote:

At 8:37 PM +0100 9/21/08, Stut wrote:
That's what the DocType is. It tells the browser what version of (X)HTML you're using and therefore which tags are allowed and which are not. It has a major effect on some browsers, and if you use the right one it can help a lot when trying to make pages look the same in all browsers. Worth reading up on.

-Stut

-Stut:

I've done a lot of reading about DOCTYPE's and I realize that the DOCTYPE statement tells the browser what version of (X)HTML the web page is, but I never made the connection that would limit how one could use the <br> tag.

You know, you can read about the "br" tag everywhere without any mention of DOCTYPE.

So in the end, we have <br>, <br/>, <br />, and <br></br> -- depending on what DOCTYPE you're using -- that sure makes things simpler, huh?

Thanks for enlightening me on this.

Cheers,

tedd

If you're using XHTML at all, when you do a 'br' tag, the '/' is required. Since XHTML (a type of XML) is only valid if well-formed, not having the trailing '/' causes the document to not be valid XML.

It does not matter if you have the space or not before the forward slash - the white space is ignored there anyway. So,

<br>

is not valid XHTML, but

<br/> and <br />

are. I personally use the one without the space. And <br></br> is just not right at all (at least for XHTML, and I doubt for any other doctype). You can look at the DTD for XHTML and see that <br></br> is not an option.

http://www.w3.org/QA/2002/04/valid-dtd-list.html

~Philip

PS... tedd, I merely piggy-backed off of your email. This was meant for the list as a whole. ;)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux