1

<dl>
  <dt>hello</dt>
  <dd>bonjour</dd><br>

  <dt>goodbye</dt>
  <dd>aurevoir</dd><br>
</dl>

So I have a dl and I want each dt -> dd pair to show on one row so it is a line break between them. I feel like this css should solve it but it does not.

dd:after {
  content:"\a";
  white-space: pre;
}

I have tried putting each dt,dd pair in a p-element or with a br-element after whitch looks like I want but makes the HTML not validate.

1 Answers1

2
dd,dt {
  display: inline;
}
dd::after {
 content: "";
 display: block;
}

Solved it for me ty for comment.

  • Wow man, this is pure poetry! You are a genius, man. This answer need to receive more attention from the community! – neoswf May 06 '22 at 22:40