MrR*_*Ray 8 html html5 semantics
我很好奇什么标签能够最具语义意义来封装一组缩略图?使用<figure>标签是否有意义(阅读html5规范,目前尚不清楚)?或坚持使用<div>,还是认为它是自己的<section>?
通常我可能会使用div来分割它,但是试图利用html5的语义结构,我希望可能会有一个更适合这种内容的标签.
思考?建议?欢迎所有人.谢谢!
从语义的角度来看,使用<figure>可能是最合适的.如果您查看HTML5规范,您会发现在一个<figure>声明中包含一系列图像是完全可以接受的.
例:
<figure>
<img src="castle1423.jpeg" title="Etching. Anonymous, ca. 1423."
alt="The castle has one tower, and a tall wall around it.">
<img src="castle1858.jpeg" title="Oil-based paint on canvas. Maria Towle, 1858."
alt="The castle now has two towers and two walls.">
<img src="castle1999.jpeg" title="Film photograph. Peter Jankle, 1999."
alt="The castle lies in ruins, the original tower all that remains in one piece.">
<figcaption>The castle through the ages: 1423, 1858, and 1999 respectively.</figcaption>
</figure>
Run Code Online (Sandbox Code Playgroud)
在HTML5Doctor.com上还有一个类似的例子,其中多个图像(可以很容易地成为缩略图)被列为单个元素的子元素.<figure>
| 归档时间: |
|
| 查看次数: |
8986 次 |
| 最近记录: |