HTML5   发布时间:2022-04-25  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了html5 – 在图标签内包装div?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我想知道将数字标签内的每个拇指的包装div放在一起是否合适(如下面的示例代码中所示)?

<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语义和拇指img元素的良好样式?

解决方法

建议使用嵌套的figure / figcaptions

<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

大佬总结

以上是大佬教程为你收集整理的html5 – 在图标签内包装div?全部内容,希望文章能够帮你解决html5 – 在图标签内包装div?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。