Dre*_*vid 6 microdata schema.org
对于网页的其他区域,标记起来很简单; 即导航元素,页眉,页脚,侧边栏
不是这样mainContentOfPage; 我已经看到了很多不同的方法来实现这一点,最近(我发现这个是最奇怪的)在schema.org本身:
<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>
Run Code Online (Sandbox Code Playgroud)
我可以用一些例子; 我的页面的主要内容在这种情况下是搜索结果页面,但我也打算在其他页面上使用它(主页,产品页面等)
编辑,我发现了一些更多的例子:
这有效吗?我在博客上发现了这个:
<div id="main" itemscope itemtype="http://schema.org/WebPageElement" itemprop="mainContentOfPage">
<p>The content</p>
</div>
Run Code Online (Sandbox Code Playgroud)
我还在另一个博客上发现了这个更简单的例子(可能太简单了?):
<div id="content" itemprop="mainContentOfPage">
<p>The content</p>
</div>
Run Code Online (Sandbox Code Playgroud)
该mainContentOfPage属性可用于WebPage并WebPageElement期望值为.
但是,Table是不是一个孩子WebPage而true不是预期值.所以这个例子实际上很奇怪,因为它不符合规范.
父母WebPage应该使用以下Table值作为mainContentOfPage:
<body itemscope itemtype="http://schema.org/WebPage">
<div itemprop="mainContentOfPage" itemscope itemtype="http://schema.org/Table">
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
编辑:更新
你的第二个例子和我的一样,它只是使用更一般的WebPageElement而不是Table.(当然你还需要一个父WebPage项,比如我的例子.)
您的第三个示例与schema.org的定义不一致,因为值是Text而不是预期WebPageElement(或子)项.
| 归档时间: |
|
| 查看次数: |
6006 次 |
| 最近记录: |