Skip to content

FAQ by category in HTML and CSS

Questions grouped under subheadings, for long FAQs.

Here is an excerpt of this component's code in HTML and CSS. The full code is free for members, ready to copy into your project.

This component also comes in

Open in a new tab

The code in HTML and CSS

index.html
<!doctype html>
<html lang="fr">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>FAQ par catégories</title>
    <link rel="stylesheet" href="style.css" />
  </head>
  <body>
    <main class="demo">
      <section class="cats">
        <h2>Questions fréquentes</h2>
style.css
:root {
  --cats-text: #2d1810;
  --cats-muted: #6b4434;
  --cats-line: #e3d3c3;
  --cats-accent: #9f2d20;
  --cats-ring: #9f2d20;
  --demo-bg: #fbf4ee;
  --demo-text: #2d1810;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {

Free component: copy it freely, including for commercial projects.

FAQ and accordions components in HTML and CSS
  • A native accordion FAQ where each answer asks “Was this answer helpful?”, with a thank-you message and a remembered vote.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • An introduction and a contact link on the left, expandable questions on the right.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A tight accordion within a single frame, for practical information pages.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • All answers visible at once, presented as a card grid.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Frequently asked questions followed by a card inviting visitors to call or write.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Questions that expand one by one, with FAQPage structured data for Google.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component