码迷,mamicode.com
首页 > Web开发 > 详细

HTML5每日一练之figure新标签的应用

时间:2014-07-18 10:35:46      阅读:356      评论:0      收藏:0      [点我收藏+]

标签:style   http   color   strong   io   html   

igure元素是一种元素的组合,可带有标题(可选)。figure标签用来表示网页上一块独立的内容,将其从网页上移除后不会对网页上的其他内容产生影响。figure所表示的内容可以是图片、统计图或代码示例。

figure用友一个子标签——figcaption标签。

注意:一个figure元素内最多只允许放置一个figcaption元素,其他元素可无限放置。


案例1:
不带有标题的figure元素:

  1. <!DOCTYPE HTML>
  2. <html>
  3.         <head>
  4.                 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5.                 <title>HTML5每日一练之figure新标签的应用-不带有标题的figure元素</title>
  6.         </head>
  7.         
  8.         <body>
  9.                 <figure>
  10.                             <img alt="W3C,W3Cfuns" src="http://www.w3cfuns.com/template/w3cfuns2011/images/logo/logo.png"/>
  11.                 </figure>
  12.         </body>
  13. </html>
复制代码

案例2:
带有标题的figure元素:

  1. <!DOCTYPE HTML>
  2. <html>
  3.         <head>
  4.                 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5.                 <title>HTML5每日一练之figure新标签的应用-带有标题的figure元素</title>
  6.         </head>
  7.         
  8.         <body>
  9.                 <figure>
  10.                             <img alt="W3C,W3Cfuns" src="http://www.w3cfuns.com/template/w3cfuns2011/images/logo/logo.png"/>
  11.                         <figcaption>W3Cfuns</figcaption>
  12.                 </figure>
  13.         </body>
  14. </html>
复制代码

案例3:
多个图片,同一个标题的figure元素:

  1. <!DOCTYPE HTML>
  2. <html>
  3.         <head>
  4.                 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5.                 <title>HTML5每日一练之figure新标签的应用-多个图片,同一个标题的figure元素</title>
  6.         </head>
  7.         
  8.         <body>
  9.                 <figure>
  10.                             <img alt="W3C,W3Cfuns" src="http://www.w3cfuns.com/template/w3cfuns2011/images/logo/logo.png"/>
  11.                             <img alt="前端工具箱" src="data/attachment/common/ee/common_185_icon.png"/>
  12.                             <img alt="每日一练" src="data/attachment/common/04/common_180_icon.png"/>
  13.                             <figcaption>W3Cfuns打造Web前端开发权威社区!</figcaption>
  14.                 </figure>
  15.         </body>
  16. </html>
复制代码

HTML5每日一练之figure新标签的应用,布布扣,bubuko.com

HTML5每日一练之figure新标签的应用

标签:style   http   color   strong   io   html   

原文地址:http://www.cnblogs.com/liweitao/p/3852713.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!