Element For A Card/card-container In Html5?
The specification for the article element says: The article element represents a component of a page that consists of a self-contained composition in a document, page, applicati
Solution 1:
It can be appropriate to use the article
element for post teasers. It depends on what content you show. For example:
- Yes: If you show the title, a description, an image, the author name, and the publication date, you should definitely use the
article
element. - No: If you only show the title, an
article
element wouldn’t be warranted, because each teaser would become an entry in the document outline (asarticle
is a sectioning content element), but there isn’t much point for an outline entry if it doesn’t contain any additional content. - Maybe: Something inbetween. Title and date? Probably not. Title and description? Probably yes.
If you decide to use article
(and only then!), you can use the bookmark
link type for the link to the full article page. This can be a hint that your article
isn’t the "full thing".
If you decide not to use article
, don’t use section
. If choosing between article
and section
, article
is the correct choice for a teaser. But if article
isn’t appropriate, you shouldn’t use another sectioning content element, but something like p
and/or ul
(and no heading elements).
Post a Comment for "Element For A Card/card-container In Html5?"