itemtype必须使用完整https schema.org url,如itemtype="https://schema.org/product";itemscope与itemtype须同元素出现;多实体需分层嵌套独立scope;itemprop值需匹配类型规范,日期用、数值去单位、url用绝对路径。

itemtype 必须是有效的 Schema.org URL
直接写 itemtype="Product" 会失效——浏览器不认缩写,必须用完整 HTTPS URL。常见错误是复制了 Google Structured Data Testing Tool 里简写的提示,但 HTML 解析器只按规范校验 URI 格式。
正确写法只有这一种:itemtype="https://schema.org/Product"(注意是 https,不是 http;末尾不加斜杠)。
其他常见类型同理:
itemtype="https://schema.org/Person"itemtype="https://schema.org/Article"itemtype="https://schema.org/LocalBusiness"
itemscope 和 itemtype 必须在同一元素上同时出现
不能把 itemscope 放父容器、itemtype 放子元素,也不能拆开写在两个标签上。microdata 解析器只认「同一 DOM 节点同时携带这两个属性」才启动类型识别。
错误示例:
<div itemscope> <div itemtype="https://schema.org/Person">...</div> </div>——这会被忽略,因为
itemtype 所在节点没有 itemscope。
正确写法:
<div itemscope itemtype="https://schema.org/Person"> <span itemprop="name">张三</span> </div>
嵌套结构要靠多层 itemscope + itemtype 拆解
一个页面常含多个实体(比如文章页有 Article,作者是 Person,发布机构是 Organization),不能指望单个 itemtype 描述全部关系。
必须显式为每个实体创建独立 scope:
- 外层
@#@#@#@#@#@#@#@#@#@0,别依赖肉眼检查属性名拼写——大小写敏感,且 <code>jobTitle和jobtitle是两个不同属性。
前端入门到VUE实战笔记:立即使用
在学习笔记中,你将探索 前端 的入门与实战技巧!











