Results 1 to 12 of 12

Thread: Using the slash in a BR tag

  1. #1

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349

    Using the slash in a BR tag

    I've seen this used quite a bit:
    Code:
    <BR />
    And when i put my code though a HTML validator it came up with loads of errors that were something about .net something or other, sorry I can't remember the exact error. Either way does anyone know when your meant to use the slash in this way? is it just meant for ASP.NET or something .

    Thanx
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    The "<br />" tag (note lowcase tag name) is the proper way of writing it and it is mandatory it is done in this way in XHTML.

    Where as most tags such as <a> have a terminating </a> tag the <br /> tag does not. Appending the "/" at the end signifies the tag has no end tag. This is also true for the <img> tag which must also contain an alt attritbute in XHTML and "<meta>" tags and any other tag which has no closing tag.

    You should code your HTML to XHTML standard as it is replacing HTML 4 which will become dprecated in time. Anyway here's the specification which lists all the differences:
    http://www.w3.org/TR/xhtml1/#diffs
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    And only if browsers would get strict about that, so would we. A quagmire, in some ways.

  4. #4

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    Bit XHTML only lets you use lower case why whats wrong with upper case, I preffer upper case becuase mit lets you see the tags easily
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  5. #5
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    Originally posted by Electroman
    Bit XHTML only lets you use lower case why whats wrong with upper case, I preffer upper case becuase mit lets you see the tags easily
    Its not all that bad. Just type everything else in upper case.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  6. #6

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    Posted by visualAd
    Its not all that bad. Just type everything else in upper case.


    But they haven't even used the lower case tags for anything, whats wrong with leaving it how it was and let the tags be case insensitive. .
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  7. #7
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    A bit more on the subject.

    <br/> tag usage is sued for any other tag in which you will have no children or other data inside of it. Like an img tag

    <img href="http://"/>

    it is basically just like <img href="http://"></img> but since nothing would ever go between the opening and closing tag, you just use the 1 tag with the slash.

    And there is nothing 'wrong' with upper case, its just that xhtml is case sensitive and they choose lower case like is used in other case sensitive web standards like javascript.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  8. #8
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    Originally posted by Cander
    like is used in other case sensitive web standards like javascript.
    Choosing lower case instead of making it mixed case (like Javascript) makes it a lot less complicated.

    I don't like upper case tags though. I've always used lower case. I think it makes it look tidier - and you don't have to keep turning the CAPS LOCK key on and off or hold down shift.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  9. #9
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    All uppercase would remind me of COBOL.

    <shudder>

    When I said javascript being lowercase, I was referring to built in functions and keywords. All the ones I have eveer used are all lower case.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  10. #10
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    Originally posted by Cander
    All the ones I have eveer used are all lower case.
    Math.round()
    abcd.charCodeAt()
    getElementById()

    Those are just a few of very many.

    Although, yes it is case sensitive.
    Last edited by Acidic; May 24th, 2004 at 10:58 AM.

  11. #11
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    ehh.Ive never seen those those myself.

    Nevermind.

    <kick in the pants>
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  12. #12
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    .readOnly

    I tore my hair out over that one.

Posting Permissions

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



Click Here to Expand Forum to Full Width