Organizing information with collapsed sections

You can streamline your Markdown by creating a collapsed section with the <details> tag.

Creating a collapsed section

You can temporarily obscure sections of your Markdown by creating a collapsed section that the reader can choose to expand. For example, when you want to include technical details in an issue comment that may not be relevant or interesting to every reader, you can put those details in a collapsed section.

Any Markdown within the <details> block will be collapsed until the reader clicks to expand the details. Within the <details> block, use the <summary> tag to create a label to the right of .

<details><summary>CLICK ME</summary>

#### We can hide anything, even code!

      puts "Hello World"


The Markdown will be collapsed by default.

Rendered collapsed

After a reader clicks , the details are expanded.

Rendered open

Further reading

Did this doc help you?

Privacy policy

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Or, learn how to contribute.