-
Notifications
You must be signed in to change notification settings - Fork 23.1k
HTML <hr> element - new examples for lists and select
#42608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Preview URLs (comment last updated: 2026-01-06 10:05:31) |
estelle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't htink we should be using the li examples
|
@estelle Thanks for the feedback. You’re absolutely right, it wasn’t a good example. I’ve replaced it with a more practical one. I’d love to hear your thoughts. |
| <li>Cut</li> | ||
| <li>Copy</li> | ||
| <li>Paste</li> | ||
| <li role="presentation"><hr /></li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have been marinating over this example, and have asked a few people in the a11y community their thoughts.
Feedback was:
Use
aria-hidden="true"in place ofrole="presentation"to completely remove the list item from the accessibility tree to keep it from being enumerated. The<hr>might have a functional purpose in that it clusters related content, but may be more confusing/annoying to a blind person than helpful, even if it is more "semantically pure."
Technically, it is a valid and accessible example, but is it a good one? Generally, if I need to create a thematic break between list items, I close out the list and open up a new list with the next "theme".
As MDN is considered gospel in many in-shop arguments over whether something is a good idea or not, I think we should omit valid content if there is a better, recommended way of doing it. By including this example, we are essentially saying "this is a good idea". So, while <hr> represents a thematic break between elements, all elements, not just paragraph level ones, it doesn't mean we need to demonstrate every use case. We should limit it to recommended use cases. I don't think we should be recommending this use case.
Description
The article about
<hr>element is basic. We can add additional examples.