line break

D

David

i'm fairly new to html so forgive me if this is a silly question

i can't work out the difference between <br> and <br />
both seem to work ok for me
in what cirumstances should each be used?

also to make paragraphs i've been using <br> to make a gap between text
buut now i've found <p> </p>
is it more proper to use <p> than <br> or doesn't it matter?

thanks
 
B

Ben C

i'm fairly new to html so forgive me if this is a silly question

i can't work out the difference between <br> and <br />
both seem to work ok for me
in what cirumstances should each be used?

They mean the same. <br/> is XHTML, <br> is HTML. Most browsers will
tolerate <br/> even in HTML, but that doesn't make it right, so use
<br> if you're using HTML.

Opinion of the gurus on alt.html etc. is that HTML is preferred over
XHTML.
also to make paragraphs i've been using <br> to make a gap between text
buut now i've found <p> </p>
is it more proper to use <p> than <br> or doesn't it matter?

Use <p> for paragraphs, <br> to break lines. What's the difference
between starting a new paragraph and putting in a line break? You
decide. If you use <p> there's more flexibility when it comes to styling
the paragraphs with CSS.

In XHTML you have to close paragraphs with </p>. In HTML you don't.
 
M

M

They mean the same. <br/> is XHTML, <br> is HTML. Most browsers will
tolerate <br/> even in HTML, but that doesn't make it right, so use
<br> if you're using HTML.

Not sure but I think the space is required if using it in HTML.

There may be issues with line spacing wrt to using paragraph tags versus
line returns.

M
 
B

Ben C

Not sure but I think the space is required if using it in HTML.

There may be issues with line spacing wrt to using paragraph tags versus
line returns.

Assuming you mean <br> by line return, yes the spacing is different.
<br> starts a new line wherever a new line should start, which is given
by the height of the previous line. But paragraphs are new block boxes
and usually have some top and bottom margin set on them by the default
stylesheet.
 
B

Beauregard T. Shagnasty

David said:
i'm fairly new to html so forgive me if this is a silly question

i can't work out the difference between <br> and <br />
both seem to work ok for me
in what cirumstances should each be used?

also to make paragraphs i've been using <br> to make a gap between
text buut now i've found <p> </p> is it more proper to use <p> than
<br> or doesn't it matter?

And now to answer the real question: use <p> ... text ... </p> for your
paragraphs. Do not use any flavor of <br> for line breaks, except
perhaps in poetry.

<p>
Listen my children and you shall hear<br>
of the midnight ride of Paul Revere.<br>
He got in his car, stepped on the gas<br>
the seat fell out, and he skinned his knee.
</p>
 
A

andrew

[....]
Do not use any flavor of <br> for line breaks, except
perhaps in poetry.

<p>
Listen my children and you shall hear<br>
of the midnight ride of Paul Revere.<br>
He got in his car, stepped on the gas<br>
the seat fell out, and he skinned his knee.
</p>

Mind you I wrestled with poetry issues when I was publishing my
father's family history site and I settled on a styled pre element,
rather than multiple <br>. An
example can be seen half way down this page('Why are the waves rolling
...'):

http://www.strong-family.org/foster/chapter_5.html

Perfect for poetry with shorter lines, with longer lines you would
have to style the overflow.

Andrew
 
D

dorayme

"Beauregard T. Shagnasty said:
Do not use any flavor of <br> for line breaks, except
perhaps in poetry.

Is this not too severe? For example, on some occasions with
pictures, there is nothing wrong with using <br> to make a
comment or caption appear underneath the picture.
 
B

Beauregard T. Shagnasty

dorayme said:
Is this not too severe? For example, on some occasions with
pictures, there is nothing wrong with using <br> to make a
comment or caption appear underneath the picture.

There are exceptions to every rule. <g>
 
B

Beauregard T. Shagnasty

andrew said:
On 2007-06-11 said:
Do not use any flavor of <br> for line breaks, except
perhaps in poetry. [and addresses]

Mind you I wrestled with poetry issues when I was publishing my
father's family history site and I settled on a styled pre element,
rather than multiple <br>. An example can be seen half way down this
page('Why are the waves rolling ..'):

That will work as well. I didn't mention it because the OP was
struggling with the use of <p>, and I didn't want to confuse him further
at this early stage.
 
J

Jonathan N. Little

dorayme said:
Is this not too severe? For example, on some occasions with
pictures, there is nothing wrong with using <br> to make a
comment or caption appear underneath the picture.

I would rather set the image to display as block and keep my options open.
 
D

dorayme

"Jonathan N. Little said:
I would rather set the image to display as block and keep my options open.

Sometimes in life, Jonathan, you have to make a decision. You
cannot keep thinking of the future like this. You will get an
ulcer. Sometimes you just have to seize the moment and close off
all options and not worry. Forever leaving things open is too
post-modernist for all tastes.
 
D

dorayme

Blinky the Shark said:
The exception to that rule is that some rules have no exceptions. :)

Actually, this is quite an interesting idea, as in paradoxical
(as in it makes the head hurt thinking about it).

But before getting into this, perhaps it can just be side stepped
because "There are exceptions to every rule" is not a rule but a
claim. Either true or false. I suspect it is false. But that a
closely related claim, in the spirit of it, is true, namely that
most rules we use have at least a few reasonable exceptions.
 
B

Ben C

Actually, this is quite an interesting idea, as in paradoxical
(as in it makes the head hurt thinking about it).

It's a good one. I think it's called a Goedel sentence.
 
B

Blinky the Shark

J

Jonathan N. Little

dorayme said:
Sometimes in life, Jonathan, you have to make a decision. You
cannot keep thinking of the future like this. You will get an
ulcer. Sometimes you just have to seize the moment and close off
all options and not worry. Forever leaving things open is too
post-modernist for all tastes.

Ah, nope! I'm the kinda guy that is always looking forward! It's those
10-years-older Denise Hoppers that live in the "now"
 
B

Ben C

Ben said:
Beauregard T. Shagnasty wrote: [...]
There are exceptions to every rule. <g>

The exception to that rule is that some rules have no exceptions. :)

Actually, this is quite an interesting idea, as in paradoxical
(as in it makes the head hurt thinking about it).

It's a good one. I think it's called a Goedel sentence.

Anyone in here ever read Doug Hofstadter's "Gödel, Escher, Bach: An
Eternal Golden Braid"? It's what got me into computers/computing as a
hobby, way back. And what actually got me thinking, again, after I'd
been out of college for a while. More than when I'd been *in* college,
come to think of it.

No but it sounds interesting. Thanks for the links, that Gary Felder
site is very good.
 

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

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top