Skip to content

Instantly share code, notes, and snippets.

@csssecrets
Last active September 19, 2021 16:29
Show Gist options
  • Save csssecrets/7eb242f4e8f078cadbca to your computer and use it in GitHub Desktop.
Save csssecrets/7eb242f4e8f078cadbca to your computer and use it in GitHub Desktop.
Inserting line breaks
/**
* Inserting line breaks
*/
dt, dd {
display: inline;
margin: 0;
}
dd {
font-weight: 600;
}
dd + dt::before {
content: "\A";
white-space: pre;
}
dd + dd::before {
content: ', ';
font-weight: normal;
margin-left: -.25em;
}
body {
font: 150%/1.6 Baskerville, Palatino, serif;
}
<dl>
<dt>Name:</dt>
<dd>Lea Verou</dd>
<dt>Email:</dt>
<dd>lea@verou.me</dd>
<dd>leaverou@mit.edu</dd>
<dt>Location:</dt>
<dd>Earth</dd>
</dl>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment