How-to guide

A FAQ that opens and closes

HTML has this built in: <details> and <summary>. Our FAQ page uses it.

Steps

  1. Ask your AI for the HTML (prompt below), or write it. Each question is a <details> with a <summary>.

  2. Paste it into a content block; the editor keeps it.

  3. Wrap it in <div class="faq"> and add the CSS below to Site CSS.

CSS

.faq details { border-bottom: 1px solid #e5e5e5; padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; position: relative; padding-right: 30px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: -2px; font-size: 1.4rem; }
.faq details[open] summary::after { content: "–"; }

Prompt for your AI

Write HTML for a FAQ inside <div class="faq">, each item as <details><summary>question</summary><p>answer</p></details>.
Questions and answers: [list]. No styles, no scripts.

← All guides

made by Content Management System