Skip to content

Commit 6ef7cc0

Browse files
committed
Set line-height of superscripts to 0
This changes it so that superscript (and in particular footnote tags) do not bump the line spacing of previous lines.
1 parent 5ec4f65 commit 6ef7cc0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/theme/css/general.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,16 @@ kbd {
190190
vertical-align: middle;
191191
}
192192

193+
sup {
194+
/* Set the line-height for superscript and footnote references so that there
195+
isn't an awkward space appearing above lines that contain the footnote.
196+
197+
See https://github.com/rust-lang/mdBook/pull/2443#discussion_r1813773583
198+
for an explanation.
199+
*/
200+
line-height: 0;
201+
}
202+
193203
:not(.footnote-definition) + .footnote-definition,
194204
.footnote-definition + :not(.footnote-definition) {
195205
margin-block-start: 2em;

0 commit comments

Comments
 (0)