189 8069 5689

如何使用HTML5创建在线精美简历

教程细节

◆  概要:HTML5的微数据API

◆  难度:初级/中级

◆  估计完成时间: 60-90分钟

将创建的最终产品

下载源文件 示例页面

2009年5月,谷歌推出了富摘要信息,在Google的搜索结果显示一个小块,使用户更容易决定哪些网页是他们搜索相关的信息。在2011年6月,谷歌宣布建立Schema.org,从谷歌、Bing和雅虎创建结构化数据的标记模式。

本教程演示了如何采用Schema.org的微数据创建一个在线的简历。本教程还包括关于如何使用作者署名标记!(译者注:Schema.org相关信息可参见http://www.rwwchina.com/2011/06/is_schemaorg_really_a_google_land_grab.html)

附加内容包括

本教程示例是一个页面的网站模板,你可以自由的作为你的网上简历使用。作为多余的奖励,多种颜色版本都包含在源文件的zip包中:深绿色,浅绿色,深蓝色和浅蓝色。

请注意,这并不是网页设计或CSS教程,所以只会提到HTML5和Schema.org的微数据标记。

现在,让我们开始吧!

第1步:CSS

创建一个名为“style.css”的CSS样式表,包括下面的代码。不要担心,这相当简单,并且理解它不是本教程的必须。

 
 
 
 
  1. /* Default Styles
  2. --------------------------------------------------- */
  3. body {
  4.     margin: 0px;
  5.     padding: 0px;
  6.     background: url("../images/bg_dark_green.png");
  7.     background-color: inherit;
  8.     font-size: 16px;
  9.     font-family: "Trebuchet MS", Helvetica, sans-serif;
  10.     color: #000;
  11. }
  12. a:link {
  13.     text-decoration: underline;
  14.     color: #000;
  15.     font-weight: bold;
  16. }
  17. a:visited {
  18.     text-decoration: underline;
  19.     color: #000;
  20.     font-weight: bold;
  21. }
  22. a:hover {
  23.     text-decoration: underline;
  24.     color: #669933;
  25.     font-weight: bold;
  26. }
  27. a:active {
  28.     text-decoration: underline;
  29.     color: #000;
  30.     font-weight: bold;
  31. }
  32. #wrapper    {
  33.     width: 965px;
  34.     margin: 0 auto;
  35. }
  36. #content {
  37.     background-color: #eee;
  38.     width: 960px;
  39.     text-align: left;
  40.     overflow: auto;
  41.     position: relative;
  42.     margin: 25px 0px 25px 0px;
  43.     border: #fff solid 2px;
  44. }
  45. .clear  {
  46.     float: none;
  47.     clear: both;
  48.     margin: 20px 0px 20px 0px;
  49. }
  50. /* Header
  51. --------------------------------------------------- */
  52. #contact-details .header_1 {
  53.     float: left;
  54.     width: 350px;
  55.     text-align: center;
  56.     margin: 40px 0px 0px 20px;
  57. }
  58. #contact-details .header_1 img {
  59.     border: #fff solid 4px;
  60.     background: url("../images/bg_img_dark_green.png");
  61.     padding: 16px;
  62.     margin: 10px 0px 0px 0px;
  63. }
  64. #contact-details .header_2 {
  65.     float: left;
  66.     width: 570px;
  67.     margin: 40px 0px 0px 10px;
  68. }
  69. #contact-details .header_2 a {
  70.     font-weight: normal;
  71. }
  72. #contact-details  h1    {
  73.     margin: 0px 0px 0px 20px;
  74.     font-size: 52px;
  75.     font-weight: bold;
  76. }
  77. #contact-details  h3    {
  78.     margin: 0px 0px 32px 20px;
  79.     font-size: 30px;
  80.     font-weight: bold;
  81.     font-style: italic;
  82. }
  83. #contact-details ul.info_1  {
  84.     list-style: none;
  85.     margin: 0px 0px 0px -12px;
  86.     font-size: 18px;
  87. }
  88. #contact-details ul.info_2  {
  89.     list-style: none;
  90.     margin: 0px 0px 15px -12px;
  91.     font-size: 18px;
  92. }
  93. #contact-details li.address {
  94.     background: url("../images/home.png") no-repeat;
  95.     background-position: 0px 0px;
  96.     padding: 0px 0px 12px 40px;
  97. }
  98. #contact-details li.phone   {
  99.     background: url("../images/phone.png") no-repeat;
  100.     background-position: 0px 0px;
  101.     padding: 0px 0px 12px 40px;
  102. }
  103. #contact-details li.email   {
  104.     background: url("../images/mail.png") no-repeat;
  105.     background-position: 0px 0px;
  106.     padding: 0px 0px 12px 40px;
  107. }
  108. #contact-details li.site_url    {
  109.     background: url("../images/computer.png") no-repeat;
  110.     background-position: 0px 2px;
  111.     padding: 0px 0px 12px 40px;
  112. }
  113. #contact-details li.twitter {
  114.     background: url("../images/twitter_sm.png") no-repeat;
  115.     background-position: 0px 0px;
  116.     padding: 0px 0px 12px 40px;
  117. }
  118. /* Main Content
  119. --------------------------------------------------- */
  120. h2.top  {
  121.     margin: 0px;
  122.     font-size: 22px;
  123.     font-weight: bold;
  124. }
  125. h2  {
  126.     margin: 40px 0px 0px 0px;
  127.     font-size: 22px;
  128.     font-weight: bold;
  129. }
  130. dl  {
  131.     margin: 0px 50px 0px 0px;
  132. }
  133. dt  {
  134.     float: left;
  135.     width: 200px;
  136.     font-size: 20px;
  137.     font-weight: bold;
  138.     font-style: italic;
  139.     text-align: right;
  140. }
  141. dd  {
  142.     width: 620px;
  143.     float: right;
  144.     margin-right: 20px;
  145. }
  146. dl#contact  {
  147.     margin: 0px;
  148. }
  149. dt#contact  {
  150.     margin: 0px;
  151. }
  152. dd#contact  {
  153.     margin: 0px;
  154. }
  155. p.bus1  {
  156.     margin: 0px;
  157.     font-weight: bold;
  158.     color: #669933;
  159. }
  160. p.edu-info  {
  161.     margin: 10px 0px 0px 0px;
  162.     font-weight: bold;
  163.     color: #669933;
  164. }
  165. p.edu-info a    {
  166.     color: #000;
  167. }
  168. p.edu-info a:hover  {
  169.     color: #669933;
  170. }
  171. p.time  {
  172.     margin: 0px;
  173. }
  174. p.summary   {
  175.     margin: 10px 0px 0px 0px;
  176. }
  177. #skills ul.list1    {
  178.     float: left;
  179.     list-style: none;
  180.     margin: 0px 0px 0px -40px;
  181.     width: 220px;
  182. }
  183. #skills ul.list2    {
  184.     float: left;
  185.     list-style: none;
  186.     margin: 0px 0px 0px 0px;
  187.     width: 220px;
  188. }
  189. #skills li {
  190.     background: url("../images/bullet_green.png") no-repeat;
  191.     background-position: 0px 2px;
  192.     padding: 0px 0px 0px 25px;
  193. }
  194. abbr    {
  195.     border-width: 0px;
  196. }
  197. /* Footer
  198. --------------------------------------------------- */
  199. #footer {
  200.     margin: 60px 40px 0px 40px;
  201. }
  202. #footer img {
  203.     border: 0px;
  204. }
  205. #footer .footer_content {
  206.     width: 700px;
  207.     overflow: auto;
  208.     margin: auto;
  209.     border: #fff solid 2px;
  210.     background-color: #dcdcdc;
  211. }
  212. #footer ul.icons_1  {
  213.     float: left;
  214.     width: 525px;
  215.     margin: 15px 10px 10px 15px;
  216.     padding: 0px;
  217. }
  218. #footer ul.icons_2  {
  219.     float: right;
  220.     width: 100px;
  221.     margin: 10px 20px 10px 10px;
  222.     padding: 0px;
  223. }
  224. #footer .icons_1 li, #footer .icons_2 li {
  225.     margin: 0px 0px 0px 7px;
  226.     padding: 0px;
  227.     list-style-type: none;
  228.     display: inline;
  229. }
  230. #footer a   {
  231.     color: #000;
  232. }
  233. #footer a:hover {
  234.     color: #669933;
  235. }
  236. #footer .credits {
  237.     float: none;
  238.     clear: both;
  239.     margin: 10px 0px 20px 0px;
  240.     font-size: 12px;
  241.     text-align: center;
  242. }
  243. #footer .credits a  {
  244.     font-weight: normal;
  245. }

#p#

第2步:页面

下一步,我们需要一个HTML文件。下面是一个我们都可能熟悉的基本布局。

 
 
 
 
  1.  
  2. Online Resume of Your Name
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  •  
  •  
  • Your Name

  • Web Developer / Designer

  •  
  • 555 Street Address, Toledo, Ohio, 43606  U.S.A.
  •  
  • (000) 000-0000
  • your-email@gmail.com
  • www.your-website.com
  • @twitter-screen-name
  •  
  •  
  •  
  •  
  •  
  •  
  • Profile:
  •  
  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
  •  
  •  
  •  
  •  
  •  
  • Skills:
  •  
  • XHTML
  • HTML5
  • PHP
  • JavaScript
  • Magento
  • WordPress
  • HTML
  • CSS
  • MySQL
  • jQuery
  • CMS Made Simple
  • Photoshop
  •  
  •  
  •  
  •  
  •  
  • Experience:
  •  
  •  
  •  
  •  
  • Web Developer / Designer
  • Company Name 1

  • February 2009 - Present

  •  
  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium.
  •  
  •  
  • Web Developer / Programmer

  • Company Name 2

  • November 2007 - February 2009

  •  
  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium.
  •  
  •  
  • Web Developer / Programmer

  • Company Name 3

  • March 2006 - November 2007

  •  
  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium.
  •  
  •  
  •  
  •  
  •  
  • Publications:
  •  
  •  
  •  
  • "How to Create an Advanced Twitter Widget", Nettuts+, 8/25/11
  •  
  •  
  •  
  •  
  •  
  • Education:
  •  
  •  
  • University of Toledo

  •  
  • 2801 Bancroft Street
  • Toledo, Ohio, 43606  U.S.A.
  •  
  • Web Design

  • 2003 - 2005

  •  
  • www.utoledo.edu
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  • Social Icons by Paul Robert Lloyd, Profile & Download Icons by DryIcons, Phone Icon by ComFi Telecom, Profile Image User Symbol by The Noun Project.
  • All used under a Creative Commons Attribution-ShareAlike license: http://creativecommons.org/licenses/by-sa/3.0/
  •  
  •  
  •  
  •  
  • #p#

    关于页面的几个说明

    HTML5 Shiv

    由于Schema.org微数据是基于HTML5微数据的规范,HTML5的标记被用来创建一页简历的网站模板。不幸的是,旧的网页浏览器如IE7和IE8不承认某些HTML5元素。在这些旧的浏览器中,使用HTML5编写的页面将无法正确呈现。

    当在IE8里点击图片查看全图时,下面是在线简历示例的截图:

    为了解决这些旧IE浏览器版本的问题,在标签间添加了如下的代码(在CSS样式表下面):

     
     
     
     
    1.   

    此代码是一个HTML5 JavaScript shim,用于让IE识别和渲染HTML5元素。

    注:在IE9和其他现代浏览器中不需要使用HTML5 JavaScript shim。

    定义列表

    我们在标记中使用

    而不是无序列表来定义列表。这是因为当考虑到每个项目都有一个标题和描述时更有意义。

    Section vs Article

    关于HTML5的Section和Article元素的使用似乎有一些混乱。我们在页面中使用Section元素,因为没有简历的段落是独立的内容。HTML5的Article元素被用在独立的内容上,例如博客文章或新闻报道。本文很好的解释了HTML5 Section和Acricle元素之间的差异 。

    第三步:添加Schema.org微数据-Person和PostalAddress

    我们首先要添加的模式类型是Person和PostalAddress。

    Itemscope元素和ItemType属性

    我们将一个itemscope元素添加到

    标签上。

     
     
     
     
    1.  Content that contains information about a Person
    2.   分享题目:如何使用HTML5创建在线精美简历
      分享URL:http://cdxtjz.cn/article/codjjdg.html

      联系我们

      您好HELLO!
      感谢您来到成都网站建设公司,若您有合作意向,请您为我们留言或使用以下方式联系我们, 我们将尽快给你回复,并为您提供真诚的设计服务,谢谢。
      • 电话:028- 86922220 18980695689
      • 商务合作邮箱:631063699@qq.com
      • 合作QQ: 532337155
      • 成都网站设计地址:成都市青羊区锣锅巷31号五金站写字楼6楼

      小谭建站工作室

      成都小谭网站建设公司拥有多年以上互联网从业经验的团队,始终保持务实的风格,以"帮助客户成功"为已任,专注于提供对客户有价值的服务。 我们已为众企业及上市公司提供专业的网站建设服务。我们不只是一家网站建设的网络公司;我们对营销、技术、管理都有自己独特见解,小谭建站采取“创意+综合+营销”一体化的方式为您提供更专业的服务!

      小谭观点

      相对传统的成都网站建设公司而言,小谭是互联网中的网站品牌策划,我们精于企业品牌与互联网相结合的整体战略服务。
      我们始终认为,网站必须注入企业基因,真正使网站成为企业vi的一部分,让整个网站品牌策划体系变的深入而持久。