Reputation: 581
I was reading an article yesterday regarding proper use of meta tags and the appropriate syntax for them. The article is here: http://searchenginewatch.com/article/2067564/How-To-Use-HTML-Meta-Tags
It seemed quite thorough. One thing that struck me as interesting was the author's assertion that:
"Don't use full quotation marks (“”) in your description. It will likely cut off your description. Use single quotes to avoid this issue."
Does this make sense? If I read her correctly, one would be writing the tag as follows:
<meta name="description" content='Awesome Description Here'>
as opposed to how it was shown in the article:
<meta name="description" content="Awesome Description Here">
I felt this was confusing and would like some clarification in order to learn the proper syntax.
Many thanks!
Upvotes: 1
Views: 2061
Reputation: 201518
The statement is plain wrong. Double quotation marks (or “full quotation marks”) can be used within an attribute value without problems or precautions, when normal, “curly” quotation marks are used—and the page specifically refers to them: “”. An attribute specification like content="Following foolish “SEO” instructions"
would do just fine.
The author probably meant to warn against using Ascii ("straight", vertical) quotation marks. The warning is not related to meta
tags in any particular way; it’s just part of general HTML syntax that the character used as attribute value delimiter cannot appear as such within the attribute value in markup.
So content="Following foolish "SEO" instructions"
would result in a syntax error (detectable by a validator). But the conclusion is wrong: if you wanted to use Ascii quotation marks in an attribute, for some odd reason, you could do that e.g. writing content='Following foolish "SEO" instructions'
or, alternatively, content="Following foolish "SEO" instructions"
.
Upvotes: 1
Reputation: 5261
You are misinterpreting the intent. The author is saying don't use full quotations INSIDE an html attribute which is using full quotations. Like so
(Bad)
<meta name="description" content="Awesome "Description" Here">
Upvotes: 4