Results 1 to 12 of 12

Thread: (html?) When to use " />" **Resolved**

  1. #1

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057

    (html?) When to use " />" **Resolved**

    I cannot remember where I read about self closing tags.
    Code:
    <br />
    <hr />
    But when do you use them? Is it going to be the new standard? Is it a good idea that I start using it?
    Thanks
    Michael
    Last edited by msimmons; Jun 27th, 2002 at 01:03 PM.
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  2. #2
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    Use that only if you use XHTML or XML. You can use it like <br></br> too but <br /> is better for backward compatibility. XHTML is the newest web standard, you should try to use it, it's not really hard, it's just that you have to be stricter with your coding and break some old bad habbits . Start with transitional and then move to strict if you are interested.

  3. #3
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    This is the XML/XHTML standard - all tags must close, unlike HTML where some are optional.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  4. #4

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    OK thanks, I don't even know what XML is (Just haven't had the time to read about it) I know it has something to do w/custom tags. So I won't bother with it for now because all I do is asp pages.
    Michael
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  5. #5
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    if there is nothing you need between an open and closing tag..you just self close the open tag. Like for intance a hr or br...why waste space typing
    <br></br>? its a waste.

    Its also appropriate for input tags. Like a button
    <input type="button"/>
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  6. #6

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    but not in html only xml/xhtml correct?
    Michael
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  7. #7
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    use it anywhere...any browser is going to catch it correctly.

    <br></br> and <br/> will do the same thing and any browser regardles wether you define the document as xhtml or not.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  8. #8
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    That's true but it won't validate if you use /> and you're not using XHTML/XML.

  9. #9
    Hyperactive Member bsw2112's Avatar
    Join Date
    Nov 2001
    Location
    ottawa, canada
    Posts
    292

    note

    according to elizabeth castro from peachpit press

    xhtml is a transition language betwenn html and xml
    xml is to be the next true standard and shtml is but a tool to facilitate the transition

    i wonder if this is true?

    bsw1212

  10. #10
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    no that is not true and wouldnt make any sense. XML is is just a standard to describe data. xhtml is a markup language that uses the xml structure standard using very specific tags and attributes.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  11. #11
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    XML + CSS will probably replace HTML eventually. Once CSS is well-defined (CSS3 columns instead of HTML tables for layout) and supported (will take a while), there really is no use for HTML.

    Code:
    <div class="menubar">
        <div class="meniitem">Code</div>
        <div class="meniitem">Code</div>
        <div class="meniitem"><span class="important">Code</span></div>
    </div>
    Code:
    <menubar>
        <menuitem>Code</menuitem>
        <menuitem>Code</menuitem>
        <menuitem><important>Code</important></menuitem>
    </menubar>
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  12. #12
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Thats right..forgot about CSS3. And I guess XForms will replace the regualr old <form> tags some day
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

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