Skip to content

Instantly share code, notes, and snippets.

@ericclemmons
Last active March 20, 2026 13:00
Show Gist options
  • Select an option

  • Save ericclemmons/b146fe5da72ca1f706b2ef72a20ac39d to your computer and use it in GitHub Desktop.

Select an option

Save ericclemmons/b146fe5da72ca1f706b2ef72a20ac39d to your computer and use it in GitHub Desktop.
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 <summary>Summary Goes Here</summary>
 ...this is hidden, collapsable content...
</details>

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details

A collapsible section with markdown

Click to expand!
def func():
    return 'hello, world!'

Nested

root
bin
nest1
a
b
c
nest2

a b c

file1
file2
file3
boot

x y z

dev

p q r

etc

e t c

home

me you everyone

lib

lib er ate

@Muaath5

Muaath5 commented Dec 23, 2023

Copy link
Copy Markdown
Level 1
Level 2
Level 3
Last Level
#include <bits/stdc++.h>
int main() {
    cout << "Hello World";
}
Level 1
Level 2
Level 3
Last Level
#include <bits/stdc++.h>
int main() {
    cout << "Hello World";
}
Level 1
Level 2
Level 3
Last Level
#include <bits/stdc++.h>
int main() {
    cout << "Hello World";
}
Level 1
Level 2
Level 3
Last Level
#include <bits/stdc++.h>
int main() {
    cout << "Hello World";
}
Level 1
Level 2
Level 3
Last Level
#include <bits/stdc++.h>
int main() {
    cout << "Hello World";
}

@eggplants

Copy link
Copy Markdown

Does anyone know how to use an image as a summary of details element?

@eggplants

eggplants commented Jan 1, 2024 •

Copy link
Copy Markdown

On click of image, I want to expand.


image

foo bar

@sonalk-ux

Copy link
Copy Markdown

😩

@DerGoogler

DerGoogler commented Sep 20, 2024 •

Copy link
Copy Markdown

Summary Goes Here

...this is hidden, collapsable content...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment