html 使用Microdata进行结构化数据标记 - https://schema.org

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html 使用Microdata进行结构化数据标记 - https://schema.org相关的知识,希望对你有一定的参考价值。

<article role="article" itemid="http://example.com/article-1" itemscope itemtype="http://schema.org/BlogPosting">
  <link itemprop="mainEntityOfPage" href="http://example.com/article-1" />
	<h2 itemprop="headline">
		<a itemprop="url" href="#" title="">Article title</a>
		Coming this April, HBO NOW will be available exclusively in the U.S. on Apple TV and the App Store.
	</h2>
	<img itemprop="image" src="http://images.apple.com/live/2015-mar-event/images/573cb_xlarge_2x.jpg">
	<p>
		Published by <cite itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Mystro Ken</span></cite>
		<time itemprop="datePublished" datetime="2015-03-09T13:08:00-07:00">March 9, 2015 1:08PM</time>
		<time itemprop="dateModified" datetime="2015-03-09T13:09:20-07:00"></time>
	</p>
	<div itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
		<span itemprop="name">Google</span>
		<span itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
			<link itemprop="url" content="https://google.com/logo.jpg">
		</span>
	</div>
	<p itemprop="description">Welcome to live coverage of the Apple Spring Forward …</p>
</article>
<body itemscope itemtype="http://schema.org/WebPage">
  <article itemprop="mainEntity" itemscope itemtype="http://schema.org/BlogPosting">
    
    <h1 itemprop="headline">
      Coming this April, HBO NOW will be available exclusively in the U.S. on Apple TV and the App Store.
    </h1>
    
	  <p itemprop="articleBody">It's $14.99 a month.<br> And for a limited time, …</p>
    
  </article>
</body>
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>Site Title</title>
    <link rel="stylesheet" href="/assets/css/style.min.css">
  </head>
  <body role="document" itemscope itemtype="https://schema.org/WebPage">
    
    
    <header role="banner" itemscope itemtype="http://schema.org/WPHeader">
      <hgroup>
        <h1 itemprop="name">Site Title</h1>
        <h2 itemprop="description">Site Description</h2>
      </hgroup>
    </header>
    
    
    <main role="main" itemscope itemprop="mainContentOfPage">
      <!-- The page's content goes here -->
    </main>
    
    
    <aside role="complementary" itemscope itemtype="http://schema.org/WPSideBar">
      <section class="widget">
        <h4 class="widget__title" itemprop="name">Site Sidebar Widget 1</h4>
        <div class="widget__text">
         <p>This is the Site Sidebar Widget 1</p>
        </div>
      </section>
      <section class="widget">
        <h4 class="widget__title" itemprop="name">Site Sidebar Widget 2</h4>
        <div class="widget__text">
         <p>This is the Site Sidebar Widget 2</p>
        </div>
      </section>
    </aside>
    
    
    <footer role="contentinfo" itemscope itemtype="http://schema.org/WPFooter">
      <p class="copyright">
        &copy; <span itemprop="copyrightYear">2017</span> 
        <span itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Person">
          <span itemprop="name">Site Holder Name</span>
        </span>.
      </p>
    </footer>
    
    
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="/assets/js/scripts.min.js"></script>
  
  </body>
</html>
<!-- Navigation -->
<nav>
  <ul role="navigation" itemscope itemtype="https://schema.org/SiteNavigationElement">
    <li itemprop="name"><a itemprop="url" href="https://example.com">Menu Item #1</a></li>
  </ul>
</nav>

<!-- Menu -->
<nav>
  <ul role="menu" itemscope itemtype="https://schema.org/SiteNavigationElement">
    <li role="menuitem" itemprop="name"><a itemprop="url" href="https://example.com">Menu Item #1</a></li>
  </ul>
</nav>

以上是关于html 使用Microdata进行结构化数据标记 - https://schema.org的主要内容,如果未能解决你的问题,请参考以下文章

HTML 企业和组织 - Rich Snippets - Microdata

php 使用HTML5 figure&figcaption,microdata和wai-aria属性改进WordPress标题短代码

Microdata:为什么Google要求在一个场地上举行活动的位置?

HTML

web系统中的结构化数据标记

web系统中的结构化数据标记