Jump to content

Help:Reference display customization

From Wikipedia, the free encyclopedia

red-outlined triangle containing exclamation pointWarning:You are not logged in. Pleasecreate an accountorlog into proceed.

You can customize how inline citations and reference lists appear to you when you are logged into your account by adding any of these rules toyour CSS.After editing,bypass your cache.

Reference list[edit]

Adjust font size[edit]

/* Set the font size for reference lists */
ol.references,
div.reflist,
div.refbegin{
font-size:90%;
}

Change 90% to the desired size. See alsoSpecial:Preferences→ Gadgets → Disable smaller font sizes of elements such as Infoboxes, Navboxes and References lists.

Suppress display[edit]

/* Suppress display of the reference list */
ol.references{
display:none;
}

Highlight clicked reference in blue[edit]

/* Highlight clicked reference in blue to help navigation */
ol.referencesli:target,
sup.reference:target,
span.citation:target{
background-color:#DEF;
}

Seeweb colors.

Put in a box with a scrollbar[edit]

/* Reference list in a box with a scrollbar */
@mediascreen{
div.reflist{
overflow-x:hidden;
overflow-y:auto;
padding-right:0.5em;
max-height:320px;
}
}

To show the reference list in a collapsible box, seeUser:TheDJ/Folded references.

Disable columns[edit]

/* Disable columns for {{reflist}} and {{refbegin}} */
.references-column-count,.references-column-width{
column-count:1!important;
column-width:auto!important;
}

To set a fixed number of columns, change1to the desired number.

Add dividers (rules) between columns[edit]

/* Add dividers (rules) between columns */
.references-column-count,.references-column-width{
column-rule:1pxsolid#aaa;
}

You can alter the appearance of the dividers by changing the values.

In-text cites[edit]

Hide in-text footnote markers[edit]

Edityour common JavaScriptand add:{{subst:lusc|User:Zhaofeng Li/RefToggle.js}}

Don't include citation numbers when selecting text (e.g. to copy and paste)[edit]

Edityour CSSto add:

sup.reference{user-select:none;}/* Don't copy citation numbers */

Keep reference superscript and subscript text from breaking the line-spacing[edit]

#contentsup.reference{
vertical-align:baseline;
position:relative;
bottom:0.33em;
}

#contentsub.reference{
vertical-align:baseline;
position:relative;
bottom:-0.25em;
}

Prevent wrapping[edit]

This fixes a cosmetic issue with Internet Explorer where a wikilink followed immediately by an in-text cite may cause the link and cite to be underlined together; not supported by IE6 and IE7

/* Add a zero-width space before the in-text citation */
sup.reference:before{
content:"\200B";text-decoration:none;
}

This will join the in-text cite to the preceding text, preventing it from wrapping; it does not add a space; does not work for Internet Explorer

/* Add a zero-width joiner before the in-text citation */
sup.reference:before{
content:"\200D";text-decoration:none;
}

Add a space before the in-text citation[edit]

This will join the in-text cite to the preceding text, preventing it from wrapping; a space will show between the text and the in-text cite; not supported by IE6 and IE7

/* Add a non-breaking space before the in-text citation */
sup.reference:before{
content:"\A0";text-decoration:none;
}

Hide the brackets for the inline cite[edit]

/* Hide the brackets for the inline cite */
sup.referenceaspan{
display:none;
}

Hide in-text cites[edit]

/* Hide in-text cites */
.reference{
display:none;
}

Larger, bolder in-text citations[edit]

/* Larger, bolder in-text citations */
psup.referencea{
font-weight:bold;
font-size:140%!important;
color:#55C!important;
background:#FFF!important;
}
hoversup.referencea{
background:#FFFF00!important;
color:#1010FF!important;
}
hoversup.referencea:visited{
color:#5A3696!important;
}
hoversup.referencea:active{
color:#FAA700!important;
background:#0808F8!important;
}

Inconspicuous in-text citations[edit]

The:before and:after pseudo-elements are not supported by IE6 and IE7

/* inconspicuous in-text citations */
sup.reference{
white-space:nowrap;
}
sup.referencea{
font-size:0.85em;
font-weight:lighter
}
sup.reference:after{
content:' ';/* non-break space after cites */
text-decoration:none;
}
sup.referenceaspan{
display:none;/* hide the brackets */
}
psup.referencea,
trsup.referencea,
captionsup.referencea,
olsup.referencea,
ulsup.referencea,
dlsup.referencea{
color:black;
}
p:hoversup.referencea,
tr:hoversup.referencea,
caption:hoversup.referencea,
ol:hoversup.referencea,
ul:hoversup.referencea,
dl:hoversup.referencea{
color:rgb(0,43,184);
text-decoration:underline;
}
p:hoversup.referencea:visited,
tr:hoversup.referencea:visited,
caption:hoversup.referencea:visited,
ol:hoversup.referencea:visited,
ul:hoversup.referencea:visited,
dl:hoversup.referencea:visited{
color:#5A3696;
}
p:hoversup.referencea:hover,
tr:hoversup.referencea:hover,
caption:hoversup.referencea:hover,
ol:hoversup.referencea:hover,
ul:hoversup.referencea:hover,
dl:hoversup.referencea:hover{
color:#002BB8;
}
p:hoversup.referencea:active,
tr:hoversup.referencea:active,
caption:hoversup.referencea:active
ol:hoversup.referencea:active,
ul:hoversup.referencea:active,
dl:hoversup.referencea:active{
color:#FAA700;
}

Pop-ups[edit]

To add pop-ups for the in-text citation that show the full citation, seeUser:Blue-Haired Lawyer/Footnote popups.

Also, the Gadget atSpecial:Preferences#mw-prefsection-gadgets->Browsing->Reference Tooltips.

Error messages[edit]

Show citation errors in all namespaces[edit]

By default error messages only show for article, user, template, category, help and file pages. Errors do not show on talk, Wikipedia, MediaWiki, portal and book unless enabled:

/*show cite errors on all pages*/
.mw-parser-outputspan.brokenref{
display:inline;
}

Show non-fatal errors[edit]

Additionally, in the Article namespace citation templates suppress non-fatal errors by default. These messages can be made visible using:

.mw-parser-outputspan.cs1-hidden-error{display:inline;}