以下是我的HTML的相关部分:
<body itemscope itemtype="http://schema.org/Corporation"> <header> <hgroup> <h1>Company name</h1> <h2 itemprop="description">Company description</h2> </hgroup> </header> <section> <h1><span itemprop="name">Company name limited</span> Offices</h1> <article itemscope itemtype="http://schema.org/LocalBusiness"> <h2 itemprop="name">Company name,Location 1 Office</h2> <p itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> <span itemprop="streetAddress">Street Address</span><br /> <span itemprop="addressLocality">Locality</span><br /> <span itemprop="addressRegion">Region</span><br /> <span itemprop="postalCode">Postcode</span><br /> <span itemprop="addressCountry">Country</span> </p> <p><a itemprop="maps" href="http://maps.Google.co.uk/blahblah">Map</a></p> <p>Telephone: <span itemprop="telephone">01234 567890</span><br /> Fax: <span itemprop="faxnumber">01234 567890</span><br /> Email: <span itemprop="email">email@domain.co.uk</span><br /> <a href="http://www.domain.co.uk" itemprop="url">http://www.domain.co.uk</a></p> <!-- itemprop="branchOf" --> </article> <article itemscope itemtype="http://schema.org/LocalBusiness"> <h2 itemprop="name">Company name,Location 2 Office</h2> <p itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> <span itemprop="streetAddress">Street Address</span><br /> <span itemprop="addressLocality">Locality</span><br /> <span itemprop="addressRegion">Region</span><br /> <span itemprop="postalCode">Postcode</span><br /> <span itemprop="addressCountry">Country</span> </p> <p><a itemprop="maps" href="http://maps.Google.co.uk/blahblah">Map</a></p> <p>Telephone: <span itemprop="telephone">01234 567890</span><br /> Fax: <span itemprop="faxnumber">01234 567890</span><br /> Email: <span itemprop="email">email@domain.co.uk</span><br /> <a href="http://www.domain.co.uk" itemprop="url">http://www.domain.co.uk</a></p> <!-- itemprop="branchOf" --> </article> </section></body>
我目前在哪里<! - itemprop =“branchOf” - >,我相信我需要将LocalBusinesses与页面前面提到的公司联系起来.
我该怎么做?可以使用元素ID吗?
谢谢.
解决方法 这是 possible with the use of theitemref
attribute: >将itemprop =“branchOf”添加到正文中
>向身体添加身份z明,例如ID = “foo” 的
>在两篇文章中添加itemref =“foo”
减少的例子:
<body ID="foo" itemprop="branchOf" itemscope itemtype="http://schema.org/Corporation"> <span itemprop="name">Company name limited</span> <article itemscope itemtype="http://schema.org/LocalBusiness" itemref="foo"> <span itemprop="name">Company name,Location 1 Office</span> </article> <article itemscope itemtype="http://schema.org/LocalBusiness" itemref="foo"> <span itemprop="name">Company name,Location 2 Office</span> </article></body>总结
以上是内存溢出为你收集整理的html – 使用schema.org Microdata中的itemprop =“branchOf”来指代LocalBusiness的母公司全部内容,希望文章能够帮你解决html – 使用schema.org Microdata中的itemprop =“branchOf”来指代LocalBusiness的母公司所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)