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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Feb 2006
    Posts
    168
    Thanks
    32
    Thanked 1 Time in 1 Post

    dispute with properly ending a meta tag

    This is a simple question. I have seen websites use these tags both way. Which one is right?


    <meta name="robots" content="index,follow">

    <meta name="keywords" content="-">

    <meta name="description" content="-">

    or

    <meta name="robots" content="index,follow"/>

    <meta name="keywords" content="-"/>

    <meta name="description" content="-"/>


    You would be surprised how many high end websites for big companies do it both ways.

    Which is correct or, does it not make a difference?


    Even The W3 html tidy function , when cleaning code, removes the / yet I though that is required to end the tag

  • #2
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,950
    Thanks
    9
    Thanked 724 Times in 718 Posts
    Depends whether you're using html or xhtml - as defined by the doctype. If the former, no closing slash is required, if the latter, it is.

    Have a look here for a simple explanation.


  •  

    Tags for this Thread

    Posting Permissions

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