php - Meta tags allowed under head section?

926

I am working on Facebook share functionality and I want site description to include in meta tags so that it will display when I share info on Facebook.

Now I want to display dynamic description for different page which I need to include in meta tags and for that I need to put my dynamic code below head section.

So my question is that,will meta tags work if I put them below head section?

975

Answer

Solution:

(Assuming that you want to use the Open Graph Protocol.)

When you are using RDFa, it’s valid to use . If you don’t use RDFa (or Microdata, and possibly other extensions), it’s not valid.

This is not allowed (usingname):

<body>
  <meta name="og:description" content="…" /> <!-- invalid -->
</body>

This is allowed (usingproperty):

<body>
  <meta property="og:description" content="…" />
</body>

If you have , it should also be allowed:

<body>
  <meta name="og:description" property="og:description" content="…" />
</body>

People are also looking for solutions to the problem: php - Automatic Log-off

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.