What does <br /> do?

N

Neredbojias

To further the education of mankind, "Mike Schumann" <mike-
(e-mail address removed)> vouchsafed:
I know that <br> specifies a new line in HTML. What does <br /> do?

The same thing in xhtml. The slash is just to close the open-ended element
in the markup's semantics.
 
D

Dennis Marks

All elements in XHTML must be closed. <BR /> would be the same as <BR></BR>
(which is probably not valid).

--
Dennis

Disclaimer: The above is my opinion. I do not guarantee it. Be sure to back
up any files involved and use at your own risk. Batteries not included. Not
for internal use. Don't run with knives.
 
J

Jonathan N. Little

Dennis said:
All elements in XHTML must be closed. <BR /> would be the same as <BR></BR>
Actually --------------------------------^^^
is not valid xhtml, HTML elements can be either uppercase or lowercase
but I believe XHTML elements must be lowercase.
 
N

News

Jonathan N. Little said:
Actually --------------------------------^^^
is not valid xhtml, HTML elements can be either uppercase or lowercase but
I believe XHTML elements must be lowercase.

I think you are correct they must be lower case but still in XHTML they must
be closed and when there is no real need for a close tag I think they do <br
/> rather than have a close tag.
 
J

Jonathan N. Little

I think you are correct they must be lower case but still in XHTML they must
be closed and when there is no real need for a close tag I think they do <br
/> rather than have a close tag.

I was not arguing about the closing of single tag elements in XTHML, yes
they must be close like <img src="some.jpg" alt="my image" /> my point
was the example was in UPPERcase.

<single_tag_elements attributes="value" />
^lowercase quoted values^ ^ ^
closing for tag-+ +-closing tag
 
N

News

Jonathan N. Little said:
I was not arguing about the closing of single tag elements in XTHML, yes
they must be close like <img src="some.jpg" alt="my image" /> my point was
the example was in UPPERcase.

<single_tag_elements attributes="value" />
^lowercase quoted values^ ^ ^
closing for tag-+ +-closing tag

Don't mind me, I worded this wrong. I am learning not exponding; learning
how to do this and I just happened to read the answer to this question and
posted it.

Sorry for the confussion
 
D

David Dorward

Mike said:
I know that <br> specifies a new line in HTML. What does <br /> do?

In XHTML, it means "A line break" (i.e. the same as <br> means in HTML).

In HTML, it means "A line break followed by a greater than sign", although
most browsers get this wrong and treat it as "A line beak".
 
M

Michael Winter

On 19/04/2006 20:15, Jonathan N. Little wrote:

[snip]
[...] I believe XHTML elements must be lowercase.

More specifically, element names in XML (and therefore XHTML) are
case-sensitive.

The elements of the XHTML namespace (http://www.w3.org/1999/xhtml) are
defined in lowercase, therefore they must appear in lowercase in a document.

Mike
 
J

Jonathan N. Little

News said:
Don't mind me, I worded this wrong. I am learning not exponding; learning
how to do this and I just happened to read the answer to this question and
posted it.

Sorry for the confussion

That's okay. Well I'll teach you something else. You are using OE for
your newsreader, I am not familiar with it, but as with most things
Microsoft it does not follow protocol. Some OE user may be able to
advise better where the setting is, but in your quoting (Which is good,
many newbies don't quote at all) you are including the signature


"Jonathan N. Little" <[email protected]> wrote in message

It's the bit here below the '--' with my name and all. Your newsreader
*should* automatically remove that, but if not you should do so
manually. It is proper 'netiquet' for newsgroups...
 
F

frederick

David said:
In XHTML, it means "A line break" (i.e. the same as <br> means in HTML).

In HTML, it means "A line break followed by a greater than sign", although
most browsers get this wrong and treat it as "A line beak".

I've never understood that, so perhaps today I'll try to get my head
around it: can you point me to the relevant reference?
 
N

News

Jonathan N. Little said:
That's okay. Well I'll teach you something else. You are using OE for your
newsreader, I am not familiar with it, but as with most things Microsoft
it does not follow protocol. Some OE user may be able to advise better
where the setting is, but in your quoting (Which is good, many newbies
don't quote at all) you are including the signature

Like this then correct?

Thanks
 
B

Bob

I've never understood that, so perhaps today I'll try to get my head
around it: can you point me to the relevant reference?

An isolated > sign, if you want it to appear in an HTML document, is
written as

&gt;

< sign if you want to show up on web, is written as

&lt;

So if you want to write an HTML tutorial on a web page you write the <i>
italic tag like this

&lt;i&gt;

K?
 
F

frederick

Bob said:
An isolated > sign, if you want it to appear in an HTML document, is
written as

&gt;

< sign if you want to show up on web, is written as

&lt;

So if you want to write an HTML tutorial on a web page you write the <i>
italic tag like this

&lt;i&gt;

I'm not at all sure why you've troubled to respond to a question that I
didn't ask and already knew the answer to. I know how to code for
angle brackets as content, thanks.

My question was why, using the original example, a fully HTML-compliant
UA should interpret "<br />" as in fact being "<br> &gt;". In other
words, why shouldn't it interpret it as if it were a malformed tag,
viz. "<br/>"?

I've been assuming that the answer is in the SGML specification rather
than that for HTML?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top