Is it a good practice to put <article>s inside <li>s?

此生再无相见时 提交于 2019-12-01 21:17:26
Terrill Thompson

The question really comes down to: What constitutes a list? If it's a list of articles, then it should be marked up as such using <li>. The advantage for screen reader users is that screen readers can use the semantic markup to communicate useful information. For example, informing the user that they've just landed on a "list of 5 items" helps them to understand how the content is organized, and how much of it there is.

That said, if each item in the list is very long or contains complex content with lots of nested elements, I agree @IanY that this could be confusing, as it then becomes difficult for users to keep track of where they are within the list.

When blocks of content are relatively large, if a sighted user isn't likely to look at that content and identify it as a list of items, then you shouldn't use <li>. If you use <article> and a heading to mark the article title, that provides a sufficient amount of semantics to facilitate navigation for screen reader users.

An article would be appropriate if it is the complete blog post. I wouldn't use it for teasers. The article tag should be for content that can stand on its own.

putting <article>s inside <li>s seems to be a misuse of <li>.

How so?

I'm not sure if doing that causes confusions to assistive technologies or not.

Not as far as I know. I’d be surprised/disappointed in the assistive technology in question if it did.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!