Skip to content

How to hide integrated TOC? #8078

Closed Answered by mocdaniel
ccmao1130 asked this question in Q&A
Mar 12, 2025 · 3 comments · 2 replies
Discussion options

You must be logged in to vote

You can use a CSS <style></style> block like the following on every page where you want to hide the integrated TOC and add the following CSS:

.md-nav__item--active .md-nav__list {
  display: none;
}

The result - two times the same page:

Without TOC

With TOC

It looks like the bottom margin of the page with the omitted TOC is a bit too large in the sidebar, but you can probably fix this with some additional inline CSS on the page in question.

Hope that helps!

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@kamilkrzyskow
Comment options

Answer selected by kamilkrzyskow
Comment options

You must be logged in to vote
1 reply
@squidfunk
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants