why use fwd slash before closing of tag? " <tag /> "

Discussion in 'HTML' started by Aniais, Dec 15, 2006.

  1. Aniais

    Aniais Guest

    I encounter this syntax occasionally, more often when HTML is mixed with PHP
    ,etc.

    can anyone explain or justify the use of fwd slash at the ending of tags?

    would it screw up html in some cases?

    thanks!

    anais
     
    Aniais, Dec 15, 2006
    #1
    1. Advertising

  2. Aniais

    Vince Morgan Guest

    "Aniais" <> wrote in message
    news:bNqgh.66171$YV4.11736@edtnps89...
    > I encounter this syntax occasionally, more often when HTML is mixed with

    PHP
    > ,etc.
    >
    > can anyone explain or justify the use of fwd slash at the ending of tags?
    >
    > would it screw up html in some cases?
    >
    > thanks!
    >
    > anais
    >
    >


    In XHTML tags must be closed. So, tags such as <BR> which are not normaly
    closed in HTML become <br/>. XHTML tags are all lower case too.
    HTH
    Vince Morgan
     
    Vince Morgan, Dec 15, 2006
    #2
    1. Advertising

  3. Aniais

    Dylan Parry Guest

    Vince Morgan wrote:

    > XHTML tags are all lower case too.


    Which isn't to say that all HTML tags are upper-case, just that it
    doesn't matter whether HTML is written in upper, lower or a mixture of
    cases.

    --
    Dylan Parry
    http://electricfreedom.org | http://webpageworkshop.co.uk

    Programming, n: A pastime similar to banging one's head
    against a wall, but with fewer opportunities for reward.
     
    Dylan Parry, Dec 15, 2006
    #3
  4. Aniais

    Andy Dingley Guest

    Re: why use fwd slash before closing of tag? " <tag /> "

    Aniais wrote:

    > I encounter this syntax occasionally, more often when HTML is mixed with PHP


    It's an XHTML feature. It's not needed for HTML and although it's
    unlikely to cause much practical trouble, it's strictly wrong to use
    it.

    Don't use XHTML. Certainly don't use XHTML unless you're fairly expert
    in its subtleties. These are not simple!

    If you want to know more, searching this group or c.i.w.a.h for
    "appendix c" will probably show some more detailed discussion of it.
     
    Andy Dingley, Dec 15, 2006
    #4
  5. Aniais

    Toby Inkster Guest

    Dylan Parry wrote:

    > Which isn't to say that all HTML tags are upper-case, just that it
    > doesn't matter whether HTML is written in upper, lower or a mixture of
    > cases.


    Except <bLOCkquOte> -- it's important that <bLOCkquOte> is written
    exactly that way.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Dec 15, 2006
    #5
  6. Aniais

    Joe (GKF) Guest

    In article <5n.co.uk>, usenet200611
    @tobyinkster.co.uk says...
    > Dylan Parry wrote:
    >
    > > Which isn't to say that all HTML tags are upper-case, just that it
    > > doesn't matter whether HTML is written in upper, lower or a mixture of
    > > cases.

    >
    > Except <bLOCkquOte> -- it's important that <bLOCkquOte> is written
    > exactly that way.
    >
    >

    Only if you're using it to provide an indent on stuff that isn't a
    quote..

    --
    Please visit -
    Water saving tips: http://graspages.cjb.cc/bigdry/
     
    Joe (GKF), Dec 17, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Davide Carboni
    Replies:
    0
    Views:
    363
    Davide Carboni
    Dec 18, 2003
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,996
    Smokey Grindel
    Dec 2, 2006
  3. Jaap
    Replies:
    0
    Views:
    526
  4. Harlan Messinger

    ASP.NET inserts trailing slash in tag

    Harlan Messinger, Feb 18, 2008, in forum: ASP .Net
    Replies:
    4
    Views:
    471
    Harlan Messinger
    Feb 19, 2008
  5. dsmithy
    Replies:
    2
    Views:
    2,909
    Peter Flynn
    Jan 17, 2010
Loading...

Share This Page