作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
对于网页的其他区域,标记起来很简单;即导航元素、页眉、页脚、侧边栏mainContentOfPage
并非如此;我已经看到了许多不同的实现方式,最近一次(我发现这是最奇怪的)在 schema.org itself 上。 :
<div itemscope itemtype="http://schema.org/Table">
<meta itemprop="mainContentOfPage" content="true"/>
<h2 itemprop="about">list of presidents</h2>
<table>
<tr><th>President</th><th>Party</th><tr>
<tr>
<td>George Washington (1789-1797)</td>
<td>no party</td>
</tr>
<tr>
<td>John Adams (1797-1801)</td>
<td>Federalist</td>
</tr>
...
</table>
</div>
<div id="main" itemscope itemtype="http://schema.org/WebPageElement" itemprop="mainContentOfPage">
<p>The content</p>
</div>
<div id="content" itemprop="mainContentOfPage">
<p>The content</p>
</div>
最佳答案
mainContentOfPage
property可用于 WebPage
并期待 WebPageElement
作为值(value)。
但是Table
不是 WebPage
的 child 和 true
不是预期值。所以这个例子实际上很奇怪,因为它不遵循规范。
一位家长 WebPage
应该使用 Table
作为 mainContentOfPage
的值:
<body itemscope itemtype="http://schema.org/WebPage">
<div itemprop="mainContentOfPage" itemscope itemtype="http://schema.org/Table">
</div>
</body>
WebPageElement
而不是
Table
. (当然,你仍然需要一个父项
WebPage
,就像我的例子一样。)
WebPageElement
(或子)项目。
关于microdata - 标记 "mainContentOfPage"的最佳方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23023263/
对于网页的其他区域,标记起来很简单;即导航元素、页眉、页脚、侧边栏 mainContentOfPage 并非如此;我已经看到了许多不同的实现方式,最近一次(我发现这是最奇怪的)在 schema.org
我想整合结构化数据mainContentOfPage采用 JSON-LD 格式。 我需要指定 DOM 的部分,所以我使用 cssSelector属性。 数据如下: { "@context":
我是一名优秀的程序员,十分优秀!