Created
November 17, 2017 15:38
-
-
Save pixelchar/db0dbffaf3506b89839b15aabbe1adbc to your computer and use it in GitHub Desktop.
Using CSS Grid for two-column <dl>s
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dl { | |
display: grid; | |
grid-template: auto / 10em 1fr; | |
} | |
dt { | |
background: #fee; | |
} | |
dd { | |
background: hsl(220, 10%, 95%); | |
} | |
dt, dd { | |
margin: 0; | |
padding: .3em .5em; | |
border-top: 1px solid rgba(0,0,0,.1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dl> | |
<dt>Foo</dt> | |
<dd>Bar</dd> | |
<dt>Foo</dt> | |
<dd>Bar</dd> | |
<dt>Foo</dt> | |
<dd>Bar</dd> | |
<dt>Foo</dt> | |
<dd>Bar</dd> | |
<dt>Foo</dt> | |
<dd>Bar</dd> | |
</dl> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment