Snippets/Page Table of contents Top-right
< Snippets
![]() | |
---|---|
Language(s): | CSS |
Compatible with: | MediaWiki all+ (all) |
Description
editThis small css code moves the page table of contents (TOC) "top-right" instead of (the default) "top-left".
Frequently the page table of contents takes up a large vertical size of the screen while more than half of the (right) screen width remains blank. Page content is needlessly shifted down with subsequent required scrolling. Moving the TOC to top-right makes better use of the available screen space and produces a better visual presentation. Frequently leading sections do not contain too much text, so it perfectly aligns with the TOC.
Visual Example
editThis page!
Usage
edit- Copy the below code to your Special:MyPage/common.css.
- You can activate it centrally for all the sister projects on m:Special:MyPage/global.css
It should work for all types and versions of MediaWiki.
Code
editTOC top-right
#toc {
border:1px solid #aaa;
background-color: #eed;
padding: 5px;
margin: 0px 5px;
font-size: 95%;
float: right;
}
Notes
editYou must be logged in, of course, to see the effect.
Template
editUse can use {{tocright}} to simulate.