MediaWiki:Common.css: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 4: | Line 4: | ||
#toc { | #toc { | ||
position: fixed; /* This makes the TOC stay in place as the user scrolls */ | |||
width: | 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; | 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: | /* Optional: Adjustments for the TOC title if needed */ | ||
#toc #toctitle { | |||
#toc | 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 */ | |||
} | } |
Revision as of 16:53, 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 */
}