LoginSignup
31
25

More than 5 years have passed since last update.

【OGP】prefix?xmlns?どっちを入れればいいのか。

Last updated at Posted at 2014-07-25

OGPの設定の際に

prefixもxmlnsも入れてくださいという紹介の仕方をされているサイトを最初に見てしまって、混乱してしまいました。それ以降もprefixが書いてあったり、xmlnsが書いてあったり・・・いったいどっちなんだろうと。

prefix
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#">
xmlns
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://ogp.me/ns/fb#" lang="ja">

気持ち悪かったのでぐぐってみたところ。

結論

xmlnsはXML用!
prefixはhtml5用!
prefixを使おう!でした。

そもそもOGP本家には、prefixの記載しかなかったです。

どこからxmlnsがわいてきたのだろう。

参考サイト

31
25
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
31
25