문제

Some seo guy told me that I should not use apostroph in meta-tags, because it is not w3c conform. I tried with several doctypes, transitional, strict , html5... and got no errors shown.

<link rel='canonical' href='someurl' />

So what is right?

도움이 되었습니까?

해결책

See the HTML5 CR, 8.1.2.3 Attributes.

There are four ways how attributes can be specified:

  • Empty attribute syntax
  • Unquoted attribute value syntax
  • Single-quoted attribute value syntax (using ' (U+0027))
  • Double-quoted attribute value syntax (using " (U+0022))

So yes, you may use '. In that case, the attribute value may not contain other ' characters (you’d have to encode them).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top