切換菜單
切換個人選單
尚未登入
如果您进行任何编辑,您的IP地址会公开展示。

Template:TOCright/doc

模板頁面
於 2023年7月4日 (二) 14:23 由 imported>Saikishiro 所做的修訂 (创建页面,内容为“{{documentation subpage}} <!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE --> # {{tl|TOCright}} forces the auto-generated Table of Contents for an article to appear in a table that is floated to the right side of the page (as seen right), in order to improve article layout. == Usage == Insert <code>{{{{BASEPAGENAME}}}}</code> at the point in the article where you want the top of the Table of Contents box to appear. Use with {{tl|-}} or…”)
(差異) ←上個修訂 | 最新修訂 (差異) | 下個修訂→ (差異)

模板樣式的src屬性不得為空。

  1. {{TOCright}} forces the auto-generated Table of Contents for an article to appear in a table that is floated to the right side of the page (as seen right), in order to improve article layout.

Usage[編輯原始碼]

Insert {{TOCright}} at the point in the article where you want the top of the Table of Contents box to appear. Use with {{-}} or {{clear}} to prevent coalition with text.

Parameters (optional)[編輯原始碼]

clear
Sets the CSS clear property, which forces this float underneath the side specified with this attribute. So, clear=right (which is the default) will place the element after all the right floating elements before it. Options are left, right, both, or none.
width
Set the CSS width.
limit
Limits the depth of subheadings shown. For instance using limit=4 will hide the fourth level and deeper subheadings in the hierarchy. And limit=2 will hide all subheadings leaving only the main headings. This is implemented as a CSS class in the MediaWiki:Common.css.

Cautions[編輯原始碼]

Usage of this template remains controversial with many editors and readers as it breaks consistency with the standardized appearance of the site. When using this template logout and check that it appears correctly with the default skin in Internet Explorer and a Acid2 compatible browser (or Firefox). Consult the following pages for placement elucidation Help:Section#Floating the TOC and Wikipedia:How to fix bunched-up edit links

  • Avoid placing the TOC in a visually poor location. Crossing a section division is probably a poor idea.
  • If the TOC is floated left of a bulleted list, the bullets will be hidden.

Site wide floating of TOC code[編輯原始碼]

Add to your userpage/monobook.css (if your using the default monobook skin)

#bodyContent #toc {
 float: right;
 clear: right;
 margin: 0.3em;
}

A more advanced (non IE users) using the CSS child selector to prevent existing TOC layout scheme from causing problems and allowing the TOC to float next to existing images.

#bodyContent > #toc, #wikiPreview > #toc {
 float: right;
 clear: none;
 padding: 0.2em;
 margin: 0.3em;
}

See also[編輯原始碼]


Cookies 幫助我們給予服務內容。依您有使用我們的服務,代表您同意我們使用 cookies。