FAQ accordion
Questions and answers in native details elements. No JavaScript. It opens and closes smoothly in browsers that support it and still works in those that do not. Use it near the end of a page to answer the objections that stop people getting in touch.
<section class="blk-section" aria-labelledby="blk-faq-title">
<div class="blk-container">
<header class="blk-head">
<div class="blk-head__main">
<h2 id="blk-faq-title">Frequently asked questions</h2>
<p>The things people ask before they get in touch.</p>
</div>
</header>
<div class="blk-faq">
<details class="blk-faq__item">
<summary>How do we start?</summary>
<p>Send a short note about the problem. We agree what a first piece of work looks like before anything is committed.</p>
</details>
<details class="blk-faq__item">
<summary>How long does a typical project take?</summary>
<p>Most start with a one to two week discovery, then move into delivery in small releases so you see progress early.</p>
</details>
<details class="blk-faq__item">
<summary>Do you work with our existing team?</summary>
<p>Yes. I usually work alongside in-house people and suppliers, and leave things documented so they can carry on.</p>
</details>
<details class="blk-faq__item">
<summary>What does it cost?</summary>
<p>It depends on scope. After the first conversation I give a fixed price for discovery and a range for the rest.</p>
</details>
</div>
</div>
</section>.blk-faq { max-width: 880px; }
.blk-faq__item { border-bottom: 1px solid var(--blk-line); }
.blk-faq__item:first-child { border-top: 1px solid var(--blk-line); }
.blk-faq__item summary { display: block; cursor: pointer; list-style: none; position: relative; padding: 22px 48px 22px 0; font-family: var(--blk-font-heading); font-weight: 600; font-size: 1.12rem; color: var(--blk-heading); transition: color .15s ease; }
.blk-faq__item summary::-webkit-details-marker { display: none; }
.blk-faq__item summary:hover, .blk-faq__item[open] > summary { color: var(--blk-accent); }
.blk-faq__item summary::after { content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; font-weight: 400; line-height: 1; color: var(--blk-accent); }
.blk-faq__item[open] > summary::after { content: "\2212"; }
.blk-faq__item p { margin: 0 0 24px; max-width: 72ch; }
@supports (interpolate-size: allow-keywords) {
.blk-faq { interpolate-size: allow-keywords; }
.blk-faq__item::details-content { block-size: 0; overflow: clip; transition: block-size .32s ease, content-visibility .32s allow-discrete; }
.blk-faq__item[open]::details-content { block-size: auto; }
}How to customise it
- Write each question the way a customer would ask it. Keep each answer to a short paragraph.
- Add
opento the firstdetailsto show one answer by default. - Because it uses the browser's own
detailselement, keyboard and screen-reader support comes built in. - Do not wrap the summary text in a heading. The summary is already the control.
Tokens it reads
--blk-accent--blk-heading--blk-ink--blk-lineAdd the "FAQ accordion" block from Product Scope Blocks (https://resources.productscope.uk/blocks/blocks/faq) 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/faq.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.