in handlebar for amp page but when i view page source on my we" /> in handlebar for amp page but when i view page source on my we" /> in handlebar for amp page but when i view page source on my we"/>

tag is not closing in view page source even after applying the closing tag in meta sra in hbs

25 Views Asked by At

i was trying to use SRA tag for ad implementation

 <meta name="amp-ad-doubleclick-sra"/>

in handlebar for amp page but when i view page source on my website, it doesn't show the closing tag it only shows `

<meta name="amp-ad-doubleclick-sra">
1

There are 1 best solutions below

0
T.J. Crowder On

That's fine, it's nothing to worry about. meta is a void element (it never has content). From that first link:

Tag omission in text/html:

   No end tag.

In HTML, void elements have only a start tag, no end tag. The / just before the > has no meaning:

  1. Then, if the element is one of the void elements, or if the element is a foreign element, then there may be a single U+002F SOLIDUS character (/), which on foreign elements marks the start tag as self-closing. On void elements, it does not mark the start tag as self-closing but instead is unnecessary and has no effect of any kind. For such void elements, it should be used only with caution — especially since, if directly preceded by an unquoted attribute value, it becomes part of the attribute value rather than being discarded by the parser.

(my emphasis)

The canonical HTML representation of the element doesn't have that unnecessary /.

The other void elements (as of this writing) are area, base, br, col, embed, hr, img, input, link, source, track, and wbr, so you'll see this with them as well.