1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

BR tag usage: with or without /

Discussion in 'HTML & Website Design' started by pixads, Sep 20, 2007.

  1. #1
    Should I use <br> or <br />?
    Why and when?
     
    pixads, Sep 20, 2007 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
  3. pixads

    pixads Well-Known Member

    Messages:
    2,015
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    145
    #3
    Thanks
    i tried serarching but nothing came out
     
    pixads, Sep 20, 2007 IP
  4. mns

    mns Member

    Messages:
    51
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    <br /> conform to W3C standard.
    every tag must closed.
     
    mns, Sep 20, 2007 IP
  5. Katy

    Katy Moderator Staff

    Messages:
    3,490
    Likes Received:
    513
    Best Answers:
    7
    Trophy Points:
    355
    #5
    LOL

    FYI: <br> for HTML documents and <br /> for XHTML documents.
     
    Katy, Sep 20, 2007 IP
  6. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #6
    Correctomundo!
     
    soulscratch, Sep 20, 2007 IP
  7. boyponga

    boyponga Banned

    Messages:
    1,013
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #7
    It is better if you put / in br if you want to validate your XHTML. Better for SE friendly sites. :D
     
    boyponga, Sep 20, 2007 IP
  8. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Actually it has nothing to do with search engines. They'll gobble up the sloppiest HTML code you can throw at them just as well as the cleanest most semantic code out there. It'll just take them longer.
     
    Dan Schulz, Sep 20, 2007 IP
  9. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #9
    To add to what Dan said, browsers and anything else do the same. Unless you go full out and serve your XHTML with the proper mime type which has problems of its own, almost anything that parses your code will be indifferent as to whether you use XHTML or good ol' HTML.
     
    krt, Sep 20, 2007 IP
  10. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #10
    WTF? Who told you that? I swear these "SEO Experts" are from a different planet.
     
    soulscratch, Sep 20, 2007 IP
  11. Jamie18

    Jamie18 Peon

    Messages:
    201
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #11
    although <br> is the correct syntax for html, i believe w3c is recommending using <br /> in your html anyways in prep for moving to xhtml in the future
     
    Jamie18, Sep 21, 2007 IP
  12. scriptman

    scriptman Peon

    Messages:
    175
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #12
    scriptman, Sep 21, 2007 IP
  13. meetgs

    meetgs Active Member

    Messages:
    957
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    70
    #13
    <br /> is the preferred way but <br> will always work, forever... and the search engines will fetch your pages without any problems. so, no worries :)
     
    meetgs, Sep 21, 2007 IP
  14. dkwallpaper.com

    dkwallpaper.com Peon

    Messages:
    600
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #14
    use <br> for fastest solution. thx. no need to worry both
     
    dkwallpaper.com, Sep 21, 2007 IP
  15. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #15
    None of you seem to get it. So allow me to jog your memory.

    
    This is a line break in HTML.<br>
    
    This is a line break in XHTML.<br />
    
    Code (markup):
    If you are using HTML, you must use the former. If you are using XHTML, you must use the latter. And if you happen to think that the browser won't care, trust me, it will.

    And furthermore, the W3C pushed XHTML years ago - it's pretty much thrown its hands in the air and said that it was a mistake and is now working with WHATWG to develop HTML 5, which ironically won't be ready for prime time for at least another decade.
     
    Dan Schulz, Sep 21, 2007 IP
  16. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #16
    Well, that's not ENTIRELY true Dan. A quirk of the SGML specification is that <br /> should actually parse ok in all browsers regardless of doctype.... it's not necessarily valid HTML, but there's no reason for a parser to choke on it either.

    But the validator sure will ;)
     
    deathshadow, Sep 21, 2007 IP
  17. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #17
    I never said anything about the browsers' "miraculous" error "handling" did I? ;)
     
    Dan Schulz, Sep 21, 2007 IP
  18. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #18
    Can't believe this thread has so many replies.
     
    soulscratch, Sep 21, 2007 IP
  19. Forrest

    Forrest Peon

    Messages:
    500
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #19
    If you use well-formed xhtml ( <br /> ) you can make tag-level changes to your site using xslt.
     
    Forrest, Sep 21, 2007 IP
  20. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #20
    Might as well forget about Internet Explorer (which still has at least 75-85% of the market btw) and serve that XHTML as an applicaiton of XML then if you do that.
     
    Dan Schulz, Sep 21, 2007 IP