Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Mar 2011
    Posts
    164
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Should a paragraph be a paragraph or <br> ?

    What I mean is -

    Do you always close a chunk of text with a </p> then start a new one or just use <br><br>

    or said another way - what is considered best practice?

    Is this normal:

    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. <br><br>

    Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>

  • #2
    Regular Coder Mooseman's Avatar
    Join Date
    Sep 2010
    Posts
    123
    Thanks
    7
    Thanked 3 Times in 3 Posts
    Separate <p> is generally better practice than <br />. It also makes styling easier for margins, etc.

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,611
    Thanks
    0
    Thanked 645 Times in 635 Posts
    You should only ever use <br/> in poetry and programming code where the spaces must go in specific places.

    Never put two <br/> next to one another.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #4
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if you use <br> inside <p> then it will create a new line within your paragraph. You can use in both ways but I prefer <p>some paragraph</p><br/><p>another paragraph</p>

  • #5
    Regular Coder
    Join Date
    Jun 2012
    Location
    Near Chicago, USA
    Posts
    123
    Thanks
    7
    Thanked 19 Times in 19 Posts
    Quote Originally Posted by muzam View Post
    if you use <br> inside <p> then it will create a new line within your paragraph. You can use in both ways but I prefer <p>some paragraph</p><br/><p>another paragraph</p>
    muzam, why the
    Code:
    <br/>
    between the two paragraphs?

    Will
    Numerology API for apps - Facebook, iPad, mobile phones. No charge to use API. [info]

  • #6
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,611
    Thanks
    0
    Thanked 645 Times in 635 Posts
    Quote Originally Posted by Will Bontrager View Post
    muzam, why the
    Code:
    <br/>
    between the two paragraphs?
    Obviously muzam hasn't realised that the same result can be achieved without the unnecessary <br/> tag simply by changing the margins on one or both paragraphs.

    <br/> tags should generally only be used WITHIN paragraphs where there is a specific position in the text that must have a line break.

    Simply using it to try to create space in the web page is wrong as that should be done with CSS.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •