how to make it break lines

Discussion in 'HTML' started by DaVinci, May 20, 2006.

  1. DaVinci

    DaVinci Guest

    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 ?
     
    DaVinci, May 20, 2006
    #1
    1. Advertising

  2. 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
     
    Jonathan N. Little, May 20, 2006
    #2
    1. Advertising

  3. 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>
     
    Jukka K. Korpela, May 20, 2006
    #3
  4. DaVinci

    pecan Guest

    "Jukka K. Korpela" <> wrote in message
    news:eek:bKbg.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/
     
    pecan, May 21, 2006
    #4
  5. 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
     
    Jonathan N. Little, May 21, 2006
    #5
  6. DaVinci

    pecan Guest

    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
     
    pecan, May 21, 2006
    #6
  7. 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
     
    Jonathan N. Little, May 21, 2006
    #7
  8. 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.
     
    Jukka K. Korpela, May 21, 2006
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wai Yip Tung
    Replies:
    5
    Views:
    1,126
    Andrew Dalke
    Sep 4, 2004
  2. saneman

    Break lines?

    saneman, Feb 26, 2008, in forum: Python
    Replies:
    3
    Views:
    458
    Tim Chase
    Feb 26, 2008
  3. Replies:
    12
    Views:
    998
  4. Zeynel
    Replies:
    3
    Views:
    371
    Zeynel
    Nov 13, 2010
  5. Ciba LO
    Replies:
    4
    Views:
    194
    Ciba LO
    Jul 8, 2006
Loading...

Share This Page