Tör*_*bor 16
有几种语义方法可以标记图像及其标题.
旧学校方法是使用HTML定义列表,以语义方式查看图像标题.(还有其他很好的教程演示了这种方法.)
<dl>
<dt><img src="foo.jpg" /></dt>
<dd>Foo</dd>
</dl>
Run Code Online (Sandbox Code Playgroud)
还有一个数字微格式适用于任何常规标记:
<div class="figure">
<img class="image" src="foo.jpeg" alt="" /><br/>
<small class="legend">Foo</small>
</div>
Run Code Online (Sandbox Code Playgroud)
HTML5现在为带有字幕<figure>和<figcaption>元素的图像提供了一种干净的直接方法.
<figure>
<img src="foo.jpg" alt="">
<figcaption>Foo</figcaption>
</figure>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3783 次 |
| 最近记录: |