Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > line break

Reply
Thread Tools

line break

 
 
David
Guest
Posts: n/a
 
      06-10-2007
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



 
Reply With Quote
 
 
 
 
Blinky the Shark
Guest
Posts: n/a
 
      06-10-2007
David wrote:

> i'm fairly new to html


And to Usenet? If you don't have that email account at none dot com
that you're flying in your From header, you're abusing none dot com's
server. Learn how to munge an address:

http://www.faqs.org/faqs/net-abuse-faq/munging-address/


--
Blinky RLU 297263
Killing all posts from Google Groups
The Usenet Improvement Project: http://blinkynet.net/comp/uip5.html
 
Reply With Quote
 
 
 
 
Ben C
Guest
Posts: n/a
 
      06-10-2007
On 2007-06-10, David <(E-Mail Removed)> wrote:
> 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.
 
Reply With Quote
 
M
Guest
Posts: n/a
 
      06-10-2007
"Ben C" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On 2007-06-10, David <(E-Mail Removed)> wrote:
>> i'm fairly new to html so forgive me if this is a silly question


> 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



 
Reply With Quote
 
Ben C
Guest
Posts: n/a
 
      06-10-2007
On 2007-06-10, M <(E-Mail Removed)> wrote:
> "Ben C" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> On 2007-06-10, David <(E-Mail Removed)> wrote:
>>> i'm fairly new to html so forgive me if this is a silly question

>
>> 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.


Do you mean <br /> as opposed to <br/>? You may be right, but either is
wrong really 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.
 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      06-11-2007
David wrote:

> 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>

--
-bts
-Motorcycles defy gravity; cars just suck
 
Reply With Quote
 
andrew
Guest
Posts: n/a
 
      06-11-2007
On 2007-06-11, Beauregard T. Shagnasty <(E-Mail Removed)> wrote:

[....]
> 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


--
Andrew's Corner
http://people.aapt.net.au/~adjlstrong/dapper.html
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      06-11-2007
In article
<kI0bi.73510$(E-Mail Removed)>,
"Beauregard T. Shagnasty" <(E-Mail Removed)> wrote:

> 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.

--
dorayme
 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      06-11-2007
dorayme wrote:

> "Beauregard T. Shagnasty" <(E-Mail Removed)> wrote:
>> 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.


There are exceptions to every rule. <g>

--
-bts
-Motorcycles defy gravity; cars just suck
 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      06-11-2007
andrew wrote:

> On 2007-06-11, Beauregard T. Shagnasty <(E-Mail Removed)> wrote:
> [....]
>> 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.

--
-bts
-Motorcycles defy gravity; cars just suck
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Read a file line by line and write each line to a file based on the5th byte scad C++ 23 05-17-2009 06:11 PM
`if (!p ? i++ : 0) break;' == `if (!p){ i++; break;}' ? lovecreatesbea...@gmail.com C Programming 12 04-14-2008 07:59 AM
How to read a text file line by line and remove some line kaushikshome C++ 4 09-10-2006 10:12 PM
Beginner: read $array with line breaks line by line Marek Stepanek Perl Misc 12 09-02-2006 10:27 AM
Read a file line by line with a maximum number of characters per line Hugo Java 10 10-18-2004 11:42 AM



Advertisments