Difference between revisions of "Template:Navbox"
Pepperonipi (talk | contribs) (Added basic documentation) |
Pepperonipi (talk | contribs) (Added Navbox CSS to template page) |
||
Line 79: | Line 79: | ||
</noinclude> | </noinclude> | ||
+ | |||
+ | {{#css: | ||
+ | table.navbox { | ||
+ | border: 1px solid #aaa; | ||
+ | width: 100%; | ||
+ | margin: auto; | ||
+ | clear: both; | ||
+ | font-size: 88%; | ||
+ | text-align: center; | ||
+ | padding: 1px; | ||
+ | } | ||
+ | |||
+ | table.navbox+table.navbox { | ||
+ | margin-top: -1px; | ||
+ | } | ||
+ | |||
+ | .navbox-title, | ||
+ | .navbox-abovebelow, | ||
+ | table.navbox th { | ||
+ | text-align: center; | ||
+ | padding-left: 1em; | ||
+ | padding-right: 1em; | ||
+ | } | ||
+ | |||
+ | .navbox-group { | ||
+ | white-space: nowrap; | ||
+ | text-align: right; | ||
+ | font-weight: bold; | ||
+ | padding-left: 1em; | ||
+ | padding-right: 1em; | ||
+ | } | ||
+ | |||
+ | .navbox, | ||
+ | .navbox-subgroup { | ||
+ | background: #fdfdfd; | ||
+ | } | ||
+ | |||
+ | .navbox-list { | ||
+ | border-color: #fdfdfd; | ||
+ | } | ||
+ | |||
+ | .navbox-title, | ||
+ | table.navbox th { | ||
+ | background: #ccccff; | ||
+ | } | ||
+ | |||
+ | .navbox-abovebelow, | ||
+ | .navbox-group, | ||
+ | .navbox-subgroup .navbox-title { | ||
+ | background: #ddddff; | ||
+ | } | ||
+ | |||
+ | .navbox-subgroup .navbox-group, | ||
+ | .navbox-subgroup .navbox-abovebelow { | ||
+ | background: #e6e6ff; | ||
+ | } | ||
+ | |||
+ | .navbox-even { | ||
+ | background: #f7f7f7; | ||
+ | } | ||
+ | |||
+ | .navbox-odd { | ||
+ | background: transparent; | ||
+ | } | ||
+ | |||
+ | .navbar.mini { | ||
+ | font-variant: small-caps; | ||
+ | } | ||
+ | |||
+ | .navbox-title p { | ||
+ | margin: 0em 0em; | ||
+ | } | ||
+ | |||
+ | .collapseButton { | ||
+ | float: right; | ||
+ | font-weight: normal; | ||
+ | text-align: right; | ||
+ | width: auto; | ||
+ | } | ||
+ | |||
+ | .navbox .collapseButton { | ||
+ | width: 6em; | ||
+ | } | ||
+ | |||
+ | #bodyContent .plainlinks a { | ||
+ | background: none !important; | ||
+ | padding: 0 !important; | ||
+ | } | ||
+ | |||
+ | .hlist dl, .hlist ol, .hlist ul { | ||
+ | margin: 0; | ||
+ | padding: 0; | ||
+ | } | ||
+ | |||
+ | .hlist dd, | ||
+ | .hlist dt, | ||
+ | .hlist li { | ||
+ | margin: 0; | ||
+ | display: inline; | ||
+ | } | ||
+ | .hlist.inline, | ||
+ | .hlist.inline dl, | ||
+ | .hlist.inline ol, | ||
+ | .hlist.inline ul, | ||
+ | .hlist dl dl, .hlist dl ol, .hlist dl ul, | ||
+ | .hlist ol dl, .hlist ol ol, .hlist ol ul, | ||
+ | .hlist ul dl, .hlist ul ol, .hlist ul ul { | ||
+ | display: inline; | ||
+ | } | ||
+ | |||
+ | .hlist .mw-empty-li, | ||
+ | .hlist .mw-empty-elt { | ||
+ | display: none; | ||
+ | } | ||
+ | .hlist dt:after { | ||
+ | content: ": "; | ||
+ | } | ||
+ | .hlist dd:after, | ||
+ | .hlist li:after { | ||
+ | content: " · "; | ||
+ | font-weight: bold; | ||
+ | } | ||
+ | .hlist dd:last-child:after, | ||
+ | .hlist dt:last-child:after, | ||
+ | .hlist li:last-child:after { | ||
+ | content: none; | ||
+ | } | ||
+ | .hlist dd dd:first-child:before, .hlist dd dt:first-child:before, .hlist dd li:first-child:before, | ||
+ | .hlist dt dd:first-child:before, .hlist dt dt:first-child:before, .hlist dt li:first-child:before, | ||
+ | .hlist li dd:first-child:before, .hlist li dt:first-child:before, .hlist li li:first-child:before { | ||
+ | content: " ("; | ||
+ | font-weight: normal; | ||
+ | } | ||
+ | .hlist dd dd:last-child:after, .hlist dd dt:last-child:after, .hlist dd li:last-child:after, | ||
+ | .hlist dt dd:last-child:after, .hlist dt dt:last-child:after, .hlist dt li:last-child:after, | ||
+ | .hlist li dd:last-child:after, .hlist li dt:last-child:after, .hlist li li:last-child:after { | ||
+ | content: ")"; | ||
+ | font-weight: normal; | ||
+ | } | ||
+ | .hlist ol { | ||
+ | counter-reset: listitem; | ||
+ | } | ||
+ | .hlist ol > li { | ||
+ | counter-increment: listitem; | ||
+ | } | ||
+ | .hlist ol > li:before { | ||
+ | content: " " counter(listitem) "\a0"; | ||
+ | } | ||
+ | .hlist dd ol > li:first-child:before, | ||
+ | .hlist dt ol > li:first-child:before, | ||
+ | .hlist li ol > li:first-child:before { | ||
+ | content: " (" counter(listitem) "\a0"; | ||
+ | } | ||
+ | }} | ||
{{#switch:{{{border|{{{1|}}}}}}|subgroup|child=|none=|#default=<nowiki/> | {{#switch:{{{border|{{{1|}}}}}}|subgroup|child=|none=|#default=<nowiki/> |
Revision as of 16:09, 29 September 2019
- Parts of this page were taken from the The English Wikipedia's documentation on the Navbox template.
This navigational template creates a box with a long list of organized links, so that a user can move between similar pages quickly. The template has default CSS styling, which can be changed as needed, although this is not recommended. This template should be used in a variety of places throughout the wiki because of its ease of use and standardization.
Parameters
name
– The name of the Navboxtitle
– The title of the Navbox (shown at the top)titlestyle
– A CSS style for the title-bar, such as:background: aqua;
groupstyle
– A CSS style for the group-cells, such as:background: #f516db;
above
– Text to appear above the group/list sectionimage
– An optional right-side image, coded as the whole image. Typically it is purely decorative, so it should be coded as[[File:XX.jpg|80px|link=|alt=]]
.imageleft
– An optional left-side image (code the same as the "image" parameter).groupn
– The left-side text before list-n (if group-n omitted, list-n extends to the left edge of the box, and defaults totext-align:center
styling).listn
– Text listing wikilinks using ahlist
format (where the wikilinks are styled as a horizontal list).below
– Optional text to appear below the group/list section.
Examples
{{Navbox
| name = Navbox/doc
| title = Title
| group1 = Group1
| list1 = List1
| group2 = Group2
| list2 =
* List 1
* List 2
| group3 = Group3
| list3 =
* List 1
* List 2
* List 3
| group4 = Group4
| list4 =
* List 1
* List 2
* List 3
* List 4
| group5 = Group5
| list5 =
* List 1
* List 2
* List 3
* List 4
* List 5
}}
|