Ky -
Ky -

Reputation: 32073

What's the best HTML5 element to contain a set of figures?

I want to have a set of 1 or more (probably no more than 10) <figure> elements in a carousel. Since I want these to fill their parent element, I don't think putting them in <li>s in an <ol> or a <ul> will be the best choice. I considered a <section> but that seems to not exactly fit the description of "a set of figures". What, if any, HTML5 semantic element(s) would be the best to contain only several related <figure>s as direct children?

This will be used as an unstyled, general, universally-useful carousel. Because of that, each figure in the carousel will contain similar, but distinct content. Examples might include information about an organization, slideshow of photos from a trip, quotes about a product, recent posts to a news site, etc.

Upvotes: 0

Views: 283

Answers (2)

Jon Hanna
Jon Hanna

Reputation: 113232

Since I want these to fill their parent element, I don't think putting them in <li>s in an <ol> or a <ul> will be the best choice.

I don't see how that follows. It seems to me that this is a list of figures, so those are the normal choices. "Filling a parent element" I would take to refer to the visual appearance, and there's no reason why a list might not have that appearance.

If you really want to directly contain the element then considering you say:

unstyled, general, universally-useful

That'd be <div>.

If another elements fits a given purpose better than <div> then you should go for it, but <div>'s value is precisely in its semantic weakness; in not matching any meaning well enough to say anything, it says nothing and so doesn't match any meaning so well as to say the wrong thing.

It also means that you can use it inside a <section>, <aside> or something else if that fits a better use. (Or perhaps define your reuse mechanism in such a way as to allow such an element to be used, with <div> as the default).

But it still sounds like a list rendered as a carousel to me, from the rest of your description.

Upvotes: 2

user4103823
user4103823

Reputation:

I think a simple div is a good idea to begin

Upvotes: 0

Related Questions