html - 将 div 包装在图形标签内?

标签 html image figure

我想知道将几个拇指中的每一个的包装 div 放在 figure 标签内是否合适(如下面的示例代码所示)?

<figure>
  <div class="img-wrapper"><img src="castle1423.jpeg" title="Etching. Anonymous, ca. 1423." alt="The castle has one tower, and a tall wall around it."></div>
  <div class="img-wrapper"><img src="castle1858.jpeg" title="Oil-based paint on canvas. Maria Towle, 1858." alt="The castle now has two towers and two walls."></div>
  <div class="img-wrapper"><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."></div>
</figure>

或者有没有更合适/更简单的方法来结合 html5 语义和 thumbs img 元素的良好样式?

最佳答案

建议使用嵌套的图形/图形标题

 <figure>
 <figcaption>The castle through the ages: 1423, 1858, and 1999 respectively.</figcaption>
 <figure>
  <figcaption>Etching. Anonymous, ca. 1423.</figcaption>
  <img src="castle1423.jpeg" alt="The castle has one tower, and a tall wall around it.">
 </figure>
 <figure>
  <figcaption>Oil-based paint on canvas. Maria Towle, 1858.</figcaption>
  <img src="castle1858.jpeg" alt="The castle now has two towers and two walls.">
 </figure>
 <figure>
  <figcaption>Film photograph. Peter Jankle, 1999.</figcaption>
  <img src="castle1999.jpeg" alt="The castle lies in ruins, the original tower all that remains in one piece.">
 </figure>
</figure>

http://www.w3.org/html/wg/drafts/html/master/grouping-content.html#the-figure-element

关于html - 将 div 包装在图形标签内?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16780525/

相关文章:

jquery - 使用 jQuery unique 过滤重复的 img src 或删除

latex - 如何在LaTeX中引用图形之前将其引用?

html - 使用CSS隐藏选择框中的选项

javascript - 尽管 API 已激活,但尝试使用嵌入 map API 时出现 ApiNotActivatedMapError

javascript - Google Chrome 中大于 16777216 像素的内容未呈现

css - 文本环绕响应图像

java - 使用 Glide 从动态 URL 加载图像

python - 如何制作Python图像 'fit'这个数字?

r - 如何在ggplot2上将图例符号与包装的图例文本对齐

javascript - 使用 Javascript 搜索 HTML 表格并保留找到匹配项的完整表格行并删除其余部分