Skip to content

Instantly share code, notes, and snippets.

@Josh68
Forked from LeaVerou/dabblet.css
Last active December 14, 2022 21:22
Show Gist options
  • Save Josh68/69f9dc059fc1b227d2542e98be4234da to your computer and use it in GitHub Desktop.
Save Josh68/69f9dc059fc1b227d2542e98be4234da to your computer and use it in GitHub Desktop.
Flexible multiline definition list
/**
* Flexible multiline definition list
*/
dl { width: 200px; display: grid; grid-template-columns: 1fr 80%; gap: .5em .25em; }
dt { counter-increment: css-counter 1; font-weight: bold; white-space: nowrap; }
dt::before { content: counter(css-counter)". "; font-weight: normal; }
dt::after { content: ":"; }
dd { margin: 0; }
<dl>
<dt>foo</dt>
<dd>Definition of foo, which goes on for a little bit</dd>
<dt>bar</dt>
<dd>Definition of bar</dd>
</dl>
<!-- Evidently it's even correct to wrap terms in `dfn` tags (within the `dt` tags) if this is a true definition list -->
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment