MediaWiki:Common.css: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 26: | Line 26: | ||
margin-top: 0; | margin-top: 0; | ||
padding-left: 1.5em; /* Adjust list indentation if needed */ | padding-left: 1.5em; /* Adjust list indentation if needed */ | ||
} | |||
#toc > ul { | |||
max-height: 350px; /* Or a percentage like 70vh */ | |||
overflow-y: auto; /* Add scrollbar if content exceeds max-height */ | |||
} | } |
Revision as of 16:55, 20 May 2025
/* CSS placed here will be applied to all skins */
#toc {
position: fixed; /* This makes the TOC stay in place as the user scrolls */
right: 10px; /* Adjust distance from the right edge as needed */
top: 7em; /* Adjust distance from the top; this might need tweaking based on your header's height */
width: 250px; /* Or your preferred width */
background-color: #f9f9f9; /* A light background color */
border: 1px solid #aaa; /* A light border */
padding: 1em;
z-index: 100; /* Ensures it stays on top of other page content */
max-height: 70vh; /* Limits the height to 70% of the viewport height */
overflow-y: auto; /* Adds a scrollbar within the TOC if its content is too long */
}
/* Optional: Adjustments for the TOC title if needed */
#toc #toctitle {
text-align: center; /* Centers the "Contents" title */
margin-bottom: 0.5em;
}
/* Optional: Ensure the list within the TOC doesn't have excessive margins */
#toc ul {
margin-top: 0;
padding-left: 1.5em; /* Adjust list indentation if needed */
}
#toc > ul {
max-height: 350px; /* Or a percentage like 70vh */
overflow-y: auto; /* Add scrollbar if content exceeds max-height */
}