0

Hello There,

I was wondering what the purpose of using <br /> and \n are, instead of just the normal HTML line break. Does this make my code more compatible with older browsers or different operating systems?

Thanks,
Mike

7
Contributors
10
Replies
11
Views
10 Years
Discussion Span
Last Post by peter_budo
0

Isn't <br> the bog standard way to do a new line anyway in html?

Also, I don't think operating system has anything to do with it? Web browsers and the way they render html are independant of OS.

0

<br/> is an xhtml version of the standard <br> tag but I have never seen </n>. The answer to the compatibility is no it won't make it anymore compatible only if you have got xhtml set in your doc type.

0

<br/> is an xhtml version of the standard <br> tag but I have never seen </n>. The answer to the compatibility is no it won't make it anymore compatible only if you have got xhtml set in your doc type.

Hey,

Sorry for not being specific enough about the \n... I was referring to the ASCII control character for a NewLine... \r would be Return Carriage and \t would be Tab... etc. etc..

What is the difference between the control character and the linebreak tag?

0

The control character linebreaks \n or \r will be shown in your markup when you view it as plain text. They can be used to organise your code better.

When it's rendered as HTML, \n, \r linebreaks aren't shown atall. You have to use <br> or <br/> or <p></p> etc to show linebreaks in rendered HTML.

0

The control character linebreaks \n or \r will be shown in your markup when you view it as plain text. They can be used to organise your code better.

When it's rendered as HTML, \n, \r linebreaks aren't shown atall. You have to use <br> or <br/> or <p></p> etc to show linebreaks in rendered HTML.

Thank you :)

0

The correct form of the br tag is:

<br />

Note the space before the /. This makes the tag work (actually fail invisibly) on older browsers.

Single tags without closing tags or closing slashes are deprecated (a fancy word meaning they plan to discontinue it shortly).

So we either have to have tags in pairs:

<li>This is a list element.</li>

Or we have to show that the tag has no closing tag with a slash before the closing angle broket.

<hr />
<img src="toon.jpg alt="cartoon of clown with stuffed helicopter" />

I think they did this so they could write code checking software which is not ambiguous.

0

Not when you have superiors or clients demanding the "latest code".

And how long do you expect W3C to allow HTML to remain on the Internet? We are being forced to change to HDTV in two years. What makes you think that this will be any different?

0

I think that tag is between script tag

please check once total code

Thanx,
sree

I think the post is over year old. Don't yoy think it is either solved or poster long forgoten about and moved on?
If you have no valuable information to pass, please do not re-open old threads!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.