Hello DT3 users,
I’d like to number the headings in my markdown documents through CSS, and I’d like those numbers to be in the margin of the page. I was able to do that with a CSS that includes the following:
body {
counter-reset: h1;
}
h1 {
display: list-item;
}
h1::marker {
counter-increment: h1;
content: counter(h1) " ";
list-style-position: outside;
}
However, that only works in Firefox. The h1::marker
pseudo-element doesn’t seem to be well supported in Chrome, Safari, or DT3. I tried using an h1::before
pseudo-element instead — for example, like this:
body {
counter-reset: h1;
}
h1::before {
counter-increment: h1;
content: counter(h1) " ";
}
But I can’t seem to figure out how to position the h1::before
pseudo-element in the margin. I’m therefore wondering whether anyone could be so kind as to point me in the right direction. Thank you for your consideration.
Sincerely,
Enrico