两个常见的meta元素属性是:
<meta name="" content="">
Run Code Online (Sandbox Code Playgroud)
和
<meta property="" content="">
Run Code Online (Sandbox Code Playgroud)
元名和元属性有什么区别?
一个组织的网站,比如"Sun Industries",想要添加一份员工名单.组织的地址和联系信息已存在于网页上,但员工列表将位于其他位置.
所以我们有
<div id="organization" itemscope itemtype="http://schema.org/Organization">
<span itemprop="name">Sun Industries</span>,
<span itemprop="location" itemscope itemtype="http://schema.org/Place">
<span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">Technologies Street 42</span>,
<span itemprop="addressLocality">Venustown</span>
<span itemprop="postalCode">98765</span>
</span>
</span>
</div>
Run Code Online (Sandbox Code Playgroud)
以后我们将在HTML5代码中
<div id="employee-1" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">John Doe</span>,
<span itemprop="jobTitle">Sales Manager</span>
</div>
Run Code Online (Sandbox Code Playgroud)
我尝试将以下子项添加到"employee-1"对象中
<meta itemprop="worksFor" itemscope itemtype="http://schema.org/Organization" itemref="organization">
Run Code Online (Sandbox Code Playgroud)
但这不起作用(至少在谷歌的结构化数据测试工具中没有).
itemref在这种情况下,如何正确使用微数据属性?为了清楚起见,我还尝试了以下方法:
itemprop="worksFor"到"组织"对象.itemref="organization"到"员工"对象.所以
<div id="organization" itemprop="worksFor" itemscope itemtype="http://schema.org/Organization">
<span itemprop="name">Sun Industries</span>,
...
</div>
...
<div id="employee-1" itemscope itemtype="http://schema.org/Person" itemref="organization">
<span itemprop="name">John Doe</span>,
<span itemprop="jobTitle">Sales …Run Code Online (Sandbox Code Playgroud) 请看这里:https://developers.google.com/structured-data/testing-tool?url = https%253A%252F%252Fglamourina.net%252Fen%252F
如何正确添加mainEntityOfPage到此站点?
在Google文档示例中,我看到如下内容:
<div itemscope itemtype="http://schema.org/NewsArticle">
<meta itemscope itemprop="mainEntityOfPage" itemType="https://schema.org/WebPage" itemid="https://google.com/article"/>
Run Code Online (Sandbox Code Playgroud)
但这是一篇单独的作者博客.它的特色是blogPosts.
<article itemscope itemtype="https://schema.org/BlogPosting" class="singlearticles">
Run Code Online (Sandbox Code Playgroud)
如果我这样改变它会是好的:
<article itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
<meta itemscope itemprop="mainEntityOfPage" itemType="https://schema.org/WebPage" itemid="https://linktoarticle"/>
Run Code Online (Sandbox Code Playgroud)
不确定我是否理解其mainEntityOfPage用法.如果有人可以建议我如何处理这个特定的案例/网站,我将不胜感激.不一般,因为每个站点可以有不同的mainEntityOfPage,但我需要知道并理解该站点的正确实现.
我用微工作,我想使用Schema.org的keywords进行CreativeWork.
模式指定它应该是文本,但我是否将每个关键字放在一个单独的元素中,itemprop="keywords"或者我将它们全部放在一个keywords元素中?如果我将它们全部放在一个元素中,我是否使用逗号作为分隔符?
我有一个显示图像的网站.显示的图像被调整大小,然后由Web应用程序缓存.但缓存是不稳定的.对于微数据,我想链接到非易失性图像.
我目前的解决方案是
<img src="cache/image-resized.jpg" />
<img src="static/image.jpg" itemprop="image" style="display:none;"/>
Run Code Online (Sandbox Code Playgroud)
这有效.Google正确解释微数据,并显示已调整大小的图像.但是用户浏览器还会下载静态图像,这是一个大图像.
那么如何在不让浏览器下载图像的情况下设置微数据图像属性呢?
我想在我的网站www.nacts.com.au上找到我喜欢的按钮,以添加到我们的Facebook页面上的按钮,但收到此消息:
你有自己的标签.这可能是因为您的格式错误并且它们在解析树中降低了,或者您不小心将Open Graph标记放在了错误的位置.无论哪种方式,您都需要在标签可用之前修复它.
但它实际上是在PHP下放置的
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://developers.facebook.com/schema/" "html xmlns:fb="http://ogp.me/ns/fb#" >
<head>
<title>North Australia Career & Training Services</title>
<meta property="fb:app_id" content="191402794307447" />
<meta property="og:title" content="North Australia Career & Training Services" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.nacts.com.au" />
<meta property="og:image" content="http://nacts.com.au/images/NACTS4.png" />
<meta property="og:site_name" content="NACTS" />
<meta property="fb:admins" content="566419298" />
<meta property="og:description" content="North Australia Career & Training Services">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="msvalidate.01" content="3123382E32539EBE8C53C2CA69F7510D" />
<meta name="google-site-verification" content="bExkQFnEooJVIoZIm70CO8H8Yjx_FfyyCC6hNE_SeoA" /> …Run Code Online (Sandbox Code Playgroud) 我想<meta>使用Schema.org使用HTML5 + Microdata 标签指定产品是否为"库存" .
我不确定这是否是正确的语法:
<div itemscope itemtype="http://schema.org/Product">
<h2 itemprop="name">Product Name</h2>
<dl itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<dt itemprop="price">$1</dt>
<meta itemprop="availability" itemscope itemtype="http://schema.org/ItemAvailability" itemid="http://schema.org/InStock">
</dl>
</div>
Run Code Online (Sandbox Code Playgroud) 我有一个公司页面,其上列有所有本地分支机构.
对于每个酒店,我正在尝试使用元标记添加branchOf属性,但Yandex和Google Snippets都为此属性显示为空白.有可能这样做吗?
<div itemscope itemtype="http://schema.org/Organization" id="schema-organization">
<meta itemprop="description" content="blah blah blah" />
<a href="/" itemprop="url">
<h1 itemprop="name">The Hotel Chain</h1>
</a>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<div itemprop="addressLocality">new york city</div>
<meta itemprop="addressRegion" content="NY" />
</div>
</div>
<!-- snip -->
<div itemscope itemtype="http://schema.org/Hotel">
<meta itemprop="branchOf" itemref="schema-organization" />
<h2 itemprop="name">Hotel Location 1</h2>
<a href="http://maps.google.com/blahblah" itemprop="map">Get directions on Google Maps</a>
<div itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates">
<meta itemprop="latitude" content="40.7450605" />
<meta itemprop="longitude" content="-73.98301879999997" />
</div>
<div class="wrap-address clearfix" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<ul class="ul-reset">
<li><span …Run Code Online (Sandbox Code Playgroud) 所以我在看Schema.org.我需要将<html>标签更改为此标记吗?
<html itemscope itemtype="http://schema.org/Article">
Run Code Online (Sandbox Code Playgroud)
或者我可以只使用我的<head></head>块中的元标记?
<meta itemprop="name" content="The Name or Title Here">
<meta itemprop="description" content="This is the page description">
<meta itemprop="image" content="http://www.example.com/image.jpg">
Run Code Online (Sandbox Code Playgroud)