4

Figure タグ内のいくつかの親指のそれぞれにラッピング 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 要素の適切なスタイリングの両方を組み合わせる、より適切で簡単な方法はありますか?

4

1 に答える 1

4

ネストされたフィギュア/フィグキャプションの使用を提案する

 <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

于 2013-05-28T15:42:03.757 に答える