SkinnyG33k
SkinnyG33k

Reputation: 1731

Is this an ok use for the article element?

I am re-writing some code for a new re-design and I am wondering if this is the best (pragmatically) semantic way to write this module?

This actually has 3-4 more items and will slide items left/right, but I paired it down a bit for SO.

Mockup enter image description here

Upvotes: 4

Views: 88

Answers (2)

unor
unor

Reputation: 96707

Yes, the use of article is fine here.

Whether the article elements should be inside of the section depends on the context of your page. If you use a sectioning element, you should give it a heading, too (but that's not a must!).

But your use of dl is wrong:

In your example, the name (dt) "Presented by" would have two values (dd): "Blue Iris Studio" and "19". The name "Walkins" would have the value "6.3". And the name "Miles Away" would have no value at all. This is not what you meant, I guess.

See the spec:

Each group must consist of one or more names (dt elements) followed by one or more values (dd elements).

The order is important here: first 1 dt, then 1 or more (!) dd. Otherwise it would not be clear which dt and dd form a group.

Upvotes: 0

Moin Zaman
Moin Zaman

Reputation: 25455

Looks fine to me. (As it satisfies the criteria as an independent item of content)

From the spec:

The article element represents a component of a page that consists of a self-contained composition in a document, page, application, or site and that is intended to be independently distributable or reusable, e.g. in syndication. This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content

Upvotes: 2

Related Questions