Table of contents
A numbered list of in-page links, separated by hairlines, with serif titles and an accent number. Use it at the top of a long guide or article so readers can jump to the part they need. Point each link at a section id further down the page.
<section class="blk-section" aria-labelledby="blk-toc-title">
<div class="blk-container blk-container--narrow">
<nav class="blk-toc" aria-labelledby="blk-toc-title">
<h2 class="blk-toc__title" id="blk-toc-title">In this guide</h2>
<ol class="blk-toc__list">
<li><a href="#">Before you go</a></li>
<li><a href="#">Getting there</a></li>
<li><a href="#">Where to stay</a></li>
<li><a href="#">What to eat</a></li>
<li><a href="#">Money and costs</a></li>
</ol>
</nav>
</div>
</section>.blk-container--narrow { max-width: var(--blk-container-narrow); }
.blk-toc { margin: 0; }
.blk-section .blk-toc__title { font-family: var(--blk-font-heading); font-size: .85rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--blk-muted); margin-bottom: 8px; }
.blk-toc__list { list-style: none; counter-reset: blk-toc; margin: 0; padding: 0; }
.blk-toc__list li { counter-increment: blk-toc; border-top: 1px solid var(--blk-line); }
.blk-toc__list li:last-child { border-bottom: 1px solid var(--blk-line); }
.blk-toc__list a { display: flex; align-items: baseline; gap: 16px; padding: 14px 4px; color: var(--blk-heading); font-family: var(--blk-font-serif); font-size: 1.3rem; text-decoration: none; transition: padding .2s ease, color .2s ease; }
.blk-toc__list a::before { content: counter(blk-toc, decimal-leading-zero); flex: none; font-family: var(--blk-font-heading); font-size: .8rem; font-weight: 600; letter-spacing: .08em; color: var(--blk-accent); }
.blk-toc__list a:hover { color: var(--blk-accent); padding-left: 14px; }How to customise it
- Change each
href="#"to the id of a heading on your page, for examplehref="#getting-there". - Numbers are generated by the CSS, so you can add or remove items without renumbering.
- Keep it to four to eight items. For a longer page, group the sections first.
- It sits in the narrow reading width. Remove
blk-container--narrowto span the page.
Tokens it reads
--blk-line--blk-heading--blk-muted--blk-accent--blk-font-serif--blk-font-heading--blk-container-narrowAdd the "Table of contents" block from Product Scope Blocks (https://resources.productscope.uk/blocks/blocks/contents) to my page. Link https://resources.productscope.uk/blocks/blocks/kit/blocks.css once. Paste the HTML from https://resources.productscope.uk/blocks/blocks/kit/blocks/contents.html and replace the placeholder text with my real content. Do not change the class names, add inline styles or add scripts. To change colours or fonts, override the --blk- variables in my own CSS. Do not invent facts, clients or numbers.