Comment by scelerat
2 months ago
I love seeing a Definition List (DL/DT/DD html tags) in the wild. Often more hassle than its worth to make them appear the way you want, but semantically pleasing and underused.
2 months ago
I love seeing a Definition List (DL/DT/DD html tags) in the wild. Often more hassle than its worth to make them appear the way you want, but semantically pleasing and underused.
combine it with a <details> and <summary> inside the <dd> and a little CSS checkbox toggle for JS-less "show all details"/"hide all details" and it's pure gold.
Their structure in the markup can be a bit confusing imo - something more like a <figcaption> inside a <figure> or a <legend> inside a <fieldset> would be much nicer imo.
The spec even mentions [0] that you're allowed to use <div>s to group dt/dd pairs for styling purposes.
[0]: https://html.spec.whatwg.org/multipage/grouping-content.html...