Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > how to make it break lines

Reply
Thread Tools

how to make it break lines

 
 
DaVinci
Guest
Posts: n/a
 
      05-20-2006
consider the codes
<html>
first line: there are some messages
second line: another line
</html>

how to make the two lines information appear as two lines rather than
make the two line become only one line.

the webpages should looks like:
first line: there are some messages
second line: another line

the webpages should not looks like:


first line: there are some messages second line: another line



is there any simple way to do it ?

 
Reply With Quote
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      05-20-2006
DaVinci wrote:
> consider the codes
> <html>
> first line: there are some messages
> second line: another line
> </html>
>
> how to make the two lines information appear as two lines rather than
> make the two line become only one line.
>
> the webpages should looks like:
> first line: there are some messages
> second line: another line
>
> the webpages should not looks like:
>
>
> first line: there are some messages second line: another line
>
>
>
> is there any simple way to do it ?
>


In a document if your want to start a new line your create a new
paragraph, right? Well, same in HTML

<p>first line: there are some messages</p>
<p>second line: another line</p>

If both are contextually in the same paragraph but your require the
second part to be on another line, happens in poetry a lot then BR
(break line)

<p>first line: there are some messages<br><second line: another line</p>


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      05-20-2006
Jonathan N. Little <> scripsit:

> In a document if your want to start a new line your create a new
> paragraph, right?


Nope.

> Well, same in HTML


Nope.

> <p>first line: there are some messages</p>
> <p>second line: another line</p>


In addition to being semantically wrong (a line does not normally constitute
a paragraph), this causes more than desired, such as vertical spacing in
graphic rendering.

> If both are contextually in the same paragraph but your require the
> second part to be on another line, happens in poetry a lot then BR
> (break line)
>
> <p>first line: there are some messages<br><second line: another
> line</p>


It still isn't a paragraph. Using <div> would be more appropriate. Moreover,
it's somewhat more logical and potentially more useful (especially in
styling) to wrap each line inside a <div> rather than use command-like
markup like <br>. That is,

<div>first line: there are some messages</div>
<div>second line: another line</div>

 
Reply With Quote
 
pecan
Guest
Posts: n/a
 
      05-21-2006

"Jukka K. Korpela" <> wrote in message
newsbKbg.3064$...
> Jonathan N. Little <> scripsit:
>
> > In a document if your want to start a new line your create a new
> > paragraph, right?

>
> Nope.
>
> > Well, same in HTML

>
> Nope.
>
> > <p>first line: there are some messages</p>
> > <p>second line: another line</p>

>
> In addition to being semantically wrong (a line does not normally

constitute
> a paragraph), this causes more than desired, such as vertical spacing in
> graphic rendering.
>
> > If both are contextually in the same paragraph but your require the
> > second part to be on another line, happens in poetry a lot then BR
> > (break line)
> >
> > <p>first line: there are some messages<br><second line: another
> > line</p>

>
> It still isn't a paragraph. Using <div> would be more appropriate.

Moreover,
> it's somewhat more logical and potentially more useful (especially in
> styling) to wrap each line inside a <div> rather than use command-like
> markup like <br>. That is,
>
> <div>first line: there are some messages</div>
> <div>second line: another line</div>
>


Is there anything wrong with using <BR>? I use it a lot, since it gives a
different spacing to the </P><P>.

CM

--
==Not nuts, just a little eccentric==
African Bush Tours and Safaris
http://www.africanbush.co.za/



 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      05-21-2006
pecan wrote:

> Is there anything wrong with using <BR>? I use it a lot, since it gives a
> different spacing to the </P><P>.


If they are separate paragraphs you should use <p>...</p><p>...</p>. If
you want to adjust the space between paragraphs then you should adjust
the margins via CSS:

P { margin: .25em; }

P { margin: 0 1em; }

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
pecan
Guest
Posts: n/a
 
      05-21-2006
Jonathan N. Little wrote:
> pecan wrote:
>
>> Is there anything wrong with using <BR>? I use it a lot, since it
>> gives a
>> different spacing to the </P><P>.

>
> If they are separate paragraphs you should use <p>...</p><p>...</p>. If
> you want to adjust the space between paragraphs then you should adjust
> the margins via CSS:
>
> P { margin: .25em; }
>
> P { margin: 0 1em; }
>


They are separate paragraphs mostly, but sometimes I just want a
sentence on a new line. The spacing I'm talking about isn't the margin,
it's the line spacing.

CM
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      05-21-2006
pecan wrote:
> Jonathan N. Little wrote:
>> pecan wrote:
>>
>>> Is there anything wrong with using <BR>? I use it a lot, since it
>>> gives a
>>> different spacing to the </P><P>.

>>
>> If they are separate paragraphs you should use <p>...</p><p>...</p>.
>> If you want to adjust the space between paragraphs then you should
>> adjust the margins via CSS:
>>
>> P { margin: .25em; }
>>
>> P { margin: 0 1em; }
>>

>
> They are separate paragraphs mostly, but sometimes I just want a
> sentence on a new line. The spacing I'm talking about isn't the margin,
> it's the line spacing.


Well if they are separate paragraphs then as stated you should do as
above use <p>...</p><p>...</p>. If you do not want to compress all your
paragraphs then create a class

..compressed { margin: 0 1em; }

<p>Regular paragraph...</p>
<p class="compressed">Compressed spacing paragraph...</p>
<p class="compressed">Compressed spacing paragraph...</p>
....

If you just need to for a new line for a specific sentence the by all
means use a BR

<p>Regular paragraph...<br>but now on a new line</p>

If you need to separate a part of a paragraph with a special treatment
sort of like an inset then enclose in DIV seems to make sense to me.

..example { margin: 0 5em; color: red; }

<p>
Some technical treatise .... for example:
<div class="example">Your example...</div>
continuing rambling discourse ...
</p>


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      05-21-2006
pecan <> scripsit:

[a fullquote, always a useful signal of lack of comprehensive reading]

> Is there anything wrong with using <BR>?


Yes, since you had to ask.

> I use it a lot, since it
> gives a different spacing to the </P><P>.


Yes, you are definitely using it wrong. Try reading a primer on HTML that
explains the basic semantics of elements.

 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
`if (!p ? i++ : 0) break;' == `if (!p){ i++; break;}' ? lovecreatesbea...@gmail.com C Programming 12 04-14-2008 07:59 AM
Correct auto line break in mail headers lines (subject)? robert Python 0 06-08-2007 12:13 PM
How to break the lines in printing to html lines? Ciba LO Perl Misc 4 07-08-2006 02:58 AM
read lines without the line break character at the end? Wai Yip Tung Python 5 09-04-2004 09:07 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57