I'm doing a website with a good HTML5 semantic structure, and a question born when I added an image gallery to an article. NB: My <figure>
is in a <article>
.
What is the best way to design a image gallery? (think accessibility)
<section>
<h1>Gallery title</h1>
<figure role="img">
<img src="../img/img1.jpg" alt="Img 1" title="image 1" />
<img src="../img/img2.jpg" alt="Img 2" title="image 2" />
<img src="../img/img3.jpg" alt="Img 3" title="image 3" />
<img src="../img/img4.jpg" alt="Img 4" title="image 4" />
</figure>
<section>
or this:
<figure role="img">
<figcaption aria-labelled="#maintitle">Gallery title</figcaption>
<div>
<img src="../img/img1.jpg" alt="Img 1" title="image 1" />
<img src="../img/img2.jpg" alt="Img 2" title="image 2" />
<img src="../img/img3.jpg" alt="Img 3" title="image 3" />
<img src="../img/img4.jpg" alt="Img 4" title="image 4" />
</div>
</figure>
Which structure is the best way? Do you have other suggestions?
Figcaption W3C: http://www.w3.org/TR/html5/grouping-content.html#the-figcaption-element figcaption HTML5Doctor: http://html5doctor.com/the-figure-figcaption-elements/
Thank you in advance to all
Geo
UPDATE: The parent structure is:
<article>
<h1 id="maintitle">Title</h1>
<p>
Lorem ipsum dolor sit amet...
</p>
<!-- GALLERY HERE-->
<section>
<!--other things, like a download area-->
</section>
</article>