Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #3279

Re: Question about new lines

Message-ID <2992742.SPkdTlGXAF@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Organization PointedEars Software (PES)
Date 2011-10-03 11:40 +0200
Subject Re: Question about new lines
Newsgroups comp.lang.php
References (1 earlier) <xn0hjvspsntovmh01r@news.individual.net> <4e889326$0$5371$9a566e8b@news.aliant.net> <xn0hjw4t3oa6h3401s@news.individual.net> <j6be24$k8h$4@news.albasani.net> <xn0hjwx4covevi801t@news.individual.net>
Followup-To comp.lang.php

Followups directed to: comp.lang.php

Show all headers | View raw


Jeff Gaines wrote:

> The Natural Philosopher wrote:
>> Jeff Gaines wrote:
>>> On 02/10/2011 in message <4e889326$0$5371$9a566e8b@news.aliant.net> 
>>> Linus Flustillbe wrote:
>>>> or we could use a <p> to force a paragraph switch.
>>>> Thanks all for your help, I have it working now.
>>> Don't forget you should close a <p> tag with </p>
>> I have never seen that ever in any source
> 
> Really?
> 
> http://www.w3schools.com/tags/tag_p.asp

W3Schools can be safely and must be strongly recommended against for use as 
a reliable resource on Web development.  When in doubt, consult the official 
Specifications:

<http://www.w3.org/TR/html401/struct/text.html#edef-P>

However, the P/p element does have an _end_ tag, and it is a good idea to 
use it so that the paragraph will be delimited *explicitly*.  In XHTML, it 
is mandatory anyway, as XHTML is an application of XML and well-formedness 
requires either an end tag or SHORTTAG syntax (as below).

> That would be an advantage of using <br /> for the OP.

<br /> is XHTML SHORTTAG (not considering HTML SHORTTAG, which is widely 
disregarded by browsers); <br>, <bR>, <Br> or <BR> is HTML.  PHP has the 
nl2br() function to make printing newlines as BR/br elements in (X)HTML 
easier.

BR/br usually suffices for debugging purposes.  However, semantics are 
important: If the intention is to make a paragraph, use the P/p element; if 
it is to make an unconditional *line break* *within* *a* *text* *paragraph*, 
use the BR/br element.


PointedEars
-- 
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
  -- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk>

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Question about new lines Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-02 14:00 +0000
  Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-02 14:17 +0000
    Re: Question about new lines Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-02 16:36 +0000
      Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-02 21:58 +0000
        Re: Question about new lines The Natural Philosopher <tnp@invalid.invalid> - 2011-10-03 05:35 +0100
          Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-03 07:53 +0000
            Re: Question about new lines Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-10-03 11:40 +0200
            Re: Question about new lines Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-03 07:26 -0400
              Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-03 11:42 +0000
                Re: Question about new lines Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-03 08:48 -0400
                Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-03 13:05 +0000
                Re: Question about new lines Robert Heller <heller@deepsoft.com> - 2011-10-03 08:49 -0500
                Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-03 14:11 +0000
                Re: Question about new lines Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-03 10:57 -0400
                Re: Question about new lines "Jeff Gaines" <jgaines_newsid@yahoo.co.uk> - 2011-10-03 15:14 +0000
                Re: Question about new lines Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-03 14:57 -0400
                Re: Question about new lines Mason Barge <masonbarge@gmail.com> - 2011-10-05 15:20 -0400
                Re: Question about new lines Tim Streater <timstreater@greenbee.net> - 2011-10-06 12:27 +0100
                Re: Question about new lines Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-03 10:54 -0400
                Re: Question about new lines Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-10-03 14:51 +0200
          Re: Question about new lines Tim Streater <timstreater@greenbee.net> - 2011-10-06 12:21 +0100
  Re: Question about new lines The Natural Philosopher <tnp@invalid.invalid> - 2011-10-02 16:21 +0100
  Re: Question about new lines Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-02 11:43 -0400
  Re: Question about new lines Denis McMahon <denismfmcmahon@gmail.com> - 2011-10-02 19:08 +0000
    Re: Question about new lines "Peter H. Coffin" <hellsop@ninehells.com> - 2011-10-02 19:57 -0500
  Re: Question about new lines Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2011-10-02 23:52 +0200
  Re: Question about new lines Gordon Burditt <gordon@hammy.burditt.org> - 2011-10-03 00:15 -0500
  Re: Question about new lines Michael Joel <no@please.com> - 2011-10-04 09:38 -0400

csiph-web