0

If we take a look at rather big list of social meta tags that should have any article today we could see that some of them have "/" before closing bracket and some do not.

<!-- Update your html tag to include the itemscope and itemtype attributes. -->
<html itemscope itemtype="http://schema.org/Article">

<!-- Place this data between the <head> tags of your website -->
<title>Page Title. Maximum length 60-70 characters</title>
<meta name="description" content="Page description. No longer than 155 characters." />

<!-- Schema.org markup for Google+ -->
<meta itemprop="name" content="The Name or Title Here">
<meta itemprop="description" content="This is the page description">
<meta itemprop="image" content="http://www.example.com/image.jpg">

<!-- Twitter Card data -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@publisher_handle">
<meta name="twitter:title" content="Page Title">
<meta name="twitter:description" content="Page description less than 200 characters">
<meta name="twitter:creator" content="@author_handle">
<!-- Twitter summary card with large image must be at least 280x150px -->
<meta name="twitter:image:src" content="http://www.example.com/image.html">

<!-- Open Graph data -->
<meta property="og:title" content="Title Here" />
<meta property="og:type" content="article" />
<meta property="og:url" content="http://www.example.com/" />
<meta property="og:image" content="http://example.com/image.jpg" />
<meta property="og:description" content="Description Here" />
<meta property="og:site_name" content="Site Name, i.e. Moz" />
<meta property="article:published_time" content="2013-09-17T05:59:00+01:00" />
<meta property="article:modified_time" content="2013-09-16T19:08:47+01:00" />
<meta property="article:section" content="Article Section" />
<meta property="article:tag" content="Article Tag" />
<meta property="fb:admins" content="Facebook numberic ID" />

I was wondering if there any particular reason behind it or it is just inconsistency of article's author that wrote this list?

1 Answer 1

6

It is inconsistency.

The rules of HTML do not require a / is needed at the end of a tag.

The rules of XML say that a / is needed for a tag that doesn't have a corresponding ending tag.

The rules of XHTML are basically a combination of XML and HTML (so the slash is needed in XHTML). Some people who work with HTML try to follow lots of rules, so they end up following the XML rules, even if adherence to the XML rules aren't needed.

However, those extra slashes really don't hurt significantly. (They just take up a tiny bit of bandwidth and associated processing power. Sites with negligible traffic aren't likely to notice.) So the webmasters can get away with being inconsistent, and it looks like that is exactly what they are doing. They might have used some software that included the slashes, and then copied and pasted those tags, while other tags were created by some different software. (Or, maybe all of that code was even created by the same software, but using different options, perhaps at different times.)

2
  • So, correct me if I am wrong, basically as of my website have doctype html meaning html5, the most correct way would be not to include "/" before tag closing, right?
    – kaytrance
    Mar 3, 2016 at 7:13
  • @kaytrance It doesn't hurt to close all HTML (5) elements, even though it's still not required by the standard. You'll benefit regarding strict validation as well as tool chain flexibility, because if you're closing them, your markup is correct XML as well and then more tools will be available. The degree of correctness in the sense of the HTML 5 standard does not change.
    – Run CMD
    Mar 3, 2016 at 7:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .