我为博客文章做了一个Schema.org标记。我不确定将<meta>与其他标记组合在一起,将<meta>放在<div>中,甚至将<meta>放在<head>之外是不是正确的方法
<article itemprop="mainEntity" itemscope="" itemtype="https://schema.org/BlogPosting">
<meta itemprop="mainEntityOfPage" itemscope="" itemtype="http://schema.org/WebPage">
<header class="entry-header">
<h1 class="entry-title" itemprop="headline">Article Title</h1>
<time itemprop="datePublished" datetime="2017-10-23T11:40:36+00:00" content="2017-10-23T11:40:36+00:00" class="date">
October 23rd, 2017
</time>
<time class="modified" itemprop="dateModified" datetime="2017-10-23T11:49:15+00:00" content="2017-10-23T11:49:15+00:00">
October 23rd, 2017
</time>
<div itemprop="author" itemscope="" itemtype="https://schema.org/Person">
<meta itemprop="image" content="http://example.com/images/nick.jpg">
<meta itemprop="name" content="nick">
<meta itemprop="url" content="http://example.com/authors/nick">
</div>
<div itemprop="publisher" itemscope="" itemtype="https://schema.org/Organization">
<div itemprop="logo" itemscope="" itemtype="https://schema.org/ImageObject">
<meta itemprop="image" src="http://example.com/logo.png">
<meta itemprop="url" content="http://example.com">
<meta itemprop="width" content="300">
<meta itemprop="height" content="270">
</div>
<meta itemprop="name" content="Publicher Name">
</div>
<meta itemprop="image" content="http://example.com/uploads/2017/10/Article-title.jpg">
</header>
<div class="entry-content jpibfi_container" itemprop="text">
</div>
</article>这种结合的原因很简单。我只是不需要向用户显示一些数据,但我需要向SE显示这些数据,我知道用display:none隐藏非样式元素不是一种好方法。
发布于 2017-10-27 15:15:43
是的,对于不可见的数据,meta元素是正确的选择。但是,如果值是URL,则使用must use a link element而不是meta元素。
meta元素的问题:
content属性:This answer describes alternatives for mainEntityOfPage.
meta不能有src属性:但如上所述,无论如何都必须使用link元素(具有href属性)。
https://stackoverflow.com/questions/46968958
复制相似问题