Skip to content

Instantly share code, notes, and snippets.

@mishoo
Last active August 29, 2015 14:11
Show Gist options
  • Save mishoo/e61da5962460aec6880f to your computer and use it in GitHub Desktop.
Save mishoo/e61da5962460aec6880f to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<style>
.counters {
counter-reset: xxx;
}
.counters > p {
counter-increment: xxx;
}
.counters > p:before {
content: "[" counter(xxx) "] ";
}
</style>
</head>
<body>
<div class="counters">
<p>Foo</p>
<p>Bar</p>
<p>Baz</p>
</div>
<script>
[].slice.call(document.querySelectorAll("p")).forEach(function(el){
console.log(el, getComputedStyle(el).counterReset);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment