Comments on: Newer Things to Know About Good Ol’ HTML Lists https://css-tricks.com/newer-things-to-know-about-good-ol-html-lists/ Tips, Tricks, and Techniques on using Cascading Style Sheets. Tue, 13 Dec 2022 13:43:30 +0000 hourly 1 https://wordpress.org/?v=6.1.1 By: Azragh https://css-tricks.com/newer-things-to-know-about-good-ol-html-lists/#comment-1798020 Tue, 13 Dec 2022 13:43:30 +0000 https://css-tricks.com/?p=375273#comment-1798020 “We can fix that with the list-style-position property” .. If you use list-style-position: inside;, the content of the list items expands all the way to the left on multiple lines. It would be much better to just apply the padding on these and leave the position on default in my opinion.

]]>
By: Adrian Roselli https://css-tricks.com/newer-things-to-know-about-good-ol-html-lists/#comment-1798011 Mon, 12 Dec 2022 20:37:33 +0000 https://css-tricks.com/?p=375273#comment-1798011 Some notes (this is a 4 item bullet list but CSS-Tricks styles eat the bullets, ironically for this post):

Probably do not add ARIA list roles for Safari/VO users unless the users themselves indicate they want them.
Probably do not add aria-label to <section> elements unless you want a <section> to be a region, in which case use aria-labelledby to reference the heading (which you should have added).
The <menu> element is exposed as an unordered list; no different accessibility APIs, no different platform APIs, nothing different in the browser. You can safely ignore <menu> unless as a developer you prefer it.
Description lists are indeed announced differently across browser and screen reader pairings, but <dl> support is generally good (with Safari being the outlier), even if you may not like how it is supported.

]]>
By: Chris J. Zähller https://css-tricks.com/newer-things-to-know-about-good-ol-html-lists/#comment-1797978 Thu, 08 Dec 2022 17:20:20 +0000 https://css-tricks.com/?p=375273#comment-1797978 In reply to JD.

The spec for <dl> changed. It used to be definition list when it was meant for glossaries. After the use cases expanded, it was changed to description list.

]]>
By: Daniel Schwarz https://css-tricks.com/newer-things-to-know-about-good-ol-html-lists/#comment-1797977 Thu, 08 Dec 2022 16:32:08 +0000 https://css-tricks.com/?p=375273#comment-1797977 In reply to JD.

Officially they’re called description lists.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl

I think definition list is just a popular misconception.

]]>
By: JD https://css-tricks.com/newer-things-to-know-about-good-ol-html-lists/#comment-1797968 Wed, 07 Dec 2022 22:56:00 +0000 https://css-tricks.com/?p=375273#comment-1797968 Most of the websites I visit to learn new things about web dev, the <dl> stands for definition list and for definition term. What I want to know is if they’re synonymous with description list and term?

]]>
By: AvaGen https://css-tricks.com/newer-things-to-know-about-good-ol-html-lists/#comment-1797933 Sun, 04 Dec 2022 08:22:53 +0000 https://css-tricks.com/?p=375273#comment-1797933 Realy nice tutorial.
Thankyou

]]>
By: Glenn https://css-tricks.com/newer-things-to-know-about-good-ol-html-lists/#comment-1797920 Fri, 02 Dec 2022 01:33:43 +0000 https://css-tricks.com/?p=375273#comment-1797920 In reply to Glenn.

I see. Thanks for the clarification Daniel.

]]>
By: Daniel Schwarz https://css-tricks.com/newer-things-to-know-about-good-ol-html-lists/#comment-1797913 Thu, 01 Dec 2022 10:23:33 +0000 https://css-tricks.com/?p=375273#comment-1797913 In reply to Glenn.

Sorry Glenn, I should have been more clear. <menu>s are unordered but not the same as <ul>s, if that makes sense? Screen readers announce them as menus, unlike <dl>s which are rather inconsistent among screen readers.

]]>
By: Claudia Da Silva https://css-tricks.com/newer-things-to-know-about-good-ol-html-lists/#comment-1797903 Wed, 30 Nov 2022 20:01:19 +0000 https://css-tricks.com/?p=375273#comment-1797903 In reply to yaireo.

For FAQ I have used and as some answers to questions are too long to let them be all opened in the browser when the page is displayed

]]>
By: Glenn https://css-tricks.com/newer-things-to-know-about-good-ol-html-lists/#comment-1797895 Wed, 30 Nov 2022 01:42:35 +0000 https://css-tricks.com/?p=375273#comment-1797895 In reply to Glenn.

Yeah Daniel it certainly “feels” like <menu> is more semantic in some cases but I was a bit thrown by the article’s line saying “They’re even exposed to the accessibility tree as unordered lists”. I was thinking “does the browser make a distinction between these things at all then?”.

]]>
By: Daniel Schwarz https://css-tricks.com/newer-things-to-know-about-good-ol-html-lists/#comment-1797893 Tue, 29 Nov 2022 20:07:45 +0000 https://css-tricks.com/?p=375273#comment-1797893 In reply to Eric Meyer.

Both great examples!

]]>
By: Daniel Schwarz https://css-tricks.com/newer-things-to-know-about-good-ol-html-lists/#comment-1797888 Tue, 29 Nov 2022 11:48:44 +0000 https://css-tricks.com/?p=375273#comment-1797888 In reply to Glenn.

In the practical sense, not much. <menu> is more semantic when using buttons (vs. links) because it’s supposed to indicate a list of interactive elements. In an ideal world, search engines would ignore them (or maybe they do already) and screen readers would announce them differently and consistently. IMO, it doesn’t hurt to use them.

]]>
By: D7460N https://css-tricks.com/newer-things-to-know-about-good-ol-html-lists/#comment-1797887 Tue, 29 Nov 2022 11:37:58 +0000 https://css-tricks.com/?p=375273#comment-1797887 In reply to Glenn.

Thank you for writing this article!

Just a thought…

Anything can be a list.

If we undo ul, ol and li built in styles anyway, why not use custom elements?

Pragmatically, which would would require more styling? Which would be more DRY for reusable components?

Feels like the dependency argument in micro. The moment we use a dependency is the moment we limit ourselves to it’s limits and (eventually, if not immediately) spend more time coding around it.

<unordered-list aria-label="Share article">
  <list-item>item01</list-item>
  <list-item>item02</list-item>
  <list-item>item03</list-item>
</unordered-list>
]]>
By: Simon https://css-tricks.com/newer-things-to-know-about-good-ol-html-lists/#comment-1797885 Tue, 29 Nov 2022 09:40:27 +0000 https://css-tricks.com/?p=375273#comment-1797885 In reply to yaireo.

I’ve also used <dl> to mark-up tabs before. Not sure how a11y compliant it was but it felt pretty semantic.

]]>
By: Eric Meyer https://css-tricks.com/newer-things-to-know-about-good-ol-html-lists/#comment-1797882 Tue, 29 Nov 2022 03:24:39 +0000 https://css-tricks.com/?p=375273#comment-1797882 Here’s a <dl> or two in the wild for you:

https://atomicarchive.com/resources/documents/effects/glasstone-dolan/glossary.html
https://meyerweb.com/eric/css/

]]>