导航
×
   ❮   
HTML CSS JavaScript PHP Go Sass W3C Colors ECMS

HTML 参考手册

HTML 元素(功能排序) HTML 浏览器支持 HTML 属性 HTML 全局属性 HTML 事件 HTML 颜色 HTML 画布 HTML 音频/视频 HTML 字符集 HTML 文档类型 HTML URL 编码 HTML 语言代码 HTML 国家代码 HTTP 状态消息 HTTP 请求方法 PX-EM 转换 键盘快捷键

HTML 标签

<!--> <!DOCTYPE> <a> <abbr> <acronym> <address> <applet> <area> <article> <aside> <audio> <b> <base> <basefont> <bdi> <bdo> <big> <blockquote> <body> <br> <button> <canvas> <caption> <center> <cite> <code> <col> <colgroup> <data> <datalist> <dd> <del> <details> <dfn> <dialog> <dir> <div> <dl> <dt> <em> <embed> <fieldset> <figcaption> <figure> <font> <footer> <form> <frame> <frameset> <h1> - <h6> <head> <header> <hr> <html> <i> <iframe> <img> <input> <ins> <kbd> <label> <legend> <li> <link> <main> <map> <mark> <meta> <meter> <nav> <noframes> <noscript> <object> <ol> <optgroup> <option> <output> <p> <param> <picture> <pre> <progress> <q> <rp> <rt> <ruby> <s> <samp> <script> <section> <select> <small> <source> <span> <strike> <strong> <style> <sub> <summary> <sup> <svg> <table> <tbody> <td> <template> <textarea> <tfoot> <th> <thead> <time> <title> <tr> <track> <tt> <u> <ul> <var> <video> <wbr>

HTML <figure> 标签


实例

使用<figure> 元素标记文档中的照片,使用<figcaption> 元素定义照片的标题:

<figure>
 <img src="pic_trulli.jpg" alt="特鲁利" style="width:100%">
 <figcaption>图 1 - 特鲁利,普利亚,意大利。</figcaption>
</figure>
亲自试一试 »

下面有更多实例。


定义和用法

<figure> 标签规定独立的流内容(图像、图表、照片、代码等等)。

figure 元素的内容应该与主内容相关,但如果被删除,则不应对文档流产生影响。

提示: <figcaption> 元素用于为 <figure> 元素添加标题。


浏览器支持

表中的数字指完全支持该元素的第一个浏览器版本。

元素          
<figure> 8.0 9.0 4.0 5.1 11.0

全局属性

<figure> 标签支持 HTML 中的全局属性


事件属性

<figure> 标签支持 HTML 中的事件属性


更多实例

实例

使用CSS设置<figure> 和<figcaption> 的样式:

   <html>
<head>
<style>
figure {
  border: 1px #cccccc solid;
      padding: 4px;
  margin: auto;
}

figcaption {
      background-color: black;
  color: white;
  font-style:     italic;
  padding: 2px;
  text-align: center;
}
</style>
</head>
<body>

<figure>
     <img src="pic_trulli.jpg" alt="特鲁利" style="width:100%">
 <figcaption>图 1 - 特鲁利,普利亚,意大利。</figcaption>
</figure>

</body>
</html>
亲自试一试 »

相关页面

HTML DOM 参考手册: Figure 对象


默认CSS设置

大多数浏览器将使用以下默认值显示 <figure> 元素:

实例

figure { 
  display: block;
  margin-top: 1em;
  margin-bottom: 1em;
      margin-left: 40px;
  margin-right: 40px;
} 
亲自试一试 »

Copyright ©2020-2026 freew3c.com All Rights Reserved 提供的内容仅用于学习和测试,不保证内容的正确性。