I'd like to have section headers (h1, h2, h3..) numbered in such a way that beginning of the text is a uniform distance from the edge of the column (much as a list does with the markers or one might use tabs in a word processor). I would like:
And not:
The difference is that the spacing for the counter is the same for all section headings in the entire document. I know how to add a fixed amount of space between the number and the text, but that isn't what I want. As said above, I'd like to to act more like a tab would in a word processor.
I'm doing the counter using the :before attribute. I tried adding "width: 4em" (or whatever), but it didn't seem to work:
I also tried using the "marker" format, but it didn't seem to work either:
Any ideas?
...
8 Introduction
9 Related Work
10 Other things
11 More things
And not:
...
8 Introduction
9 Related Work
10 Other things
11 More things
The difference is that the spacing for the counter is the same for all section headings in the entire document. I know how to add a fixed amount of space between the number and the text, but that isn't what I want. As said above, I'd like to to act more like a tab would in a word processor.
I'm doing the counter using the :before attribute. I tried adding "width: 4em" (or whatever), but it didn't seem to work:
h1:before {
content: counter(h1) " ";
width: 4em;
}
I also tried using the "marker" format, but it didn't seem to work either:
h1:before {
content: counter(h1) " ";
display: marker;
marker-offset: 5em;
}
Any ideas?