Manual:CSS

From MediaWiki.org
Jump to: navigation, search
Did you mean: Extension:CSS?

Cascading style sheet (CSS) markup sets much of the look and feel of MediaWiki -- font size, colors, spacing, the logo and background image, even whether stuff is displayed or is hidden.

CSS can be used to change the style of the entire wiki, for example to make the background a different colour, or you can use inline css to style specific pieces of text in your wiki. For example green text can be accomplished by doing <span style="color:green">green text</span>. If you want to make all text on the wiki green you can add the code * {color:green} to mediawiki:Common.css.

To change the look and feel of MediaWiki's monitor and projector display (how it looks in a browser window) you can put CSS into MediaWiki:Common.css.

Note: If code added to mediawiki:Common.css doesn't take effect immediately, you may have to do a hard refresh

To change the way MediaWiki pages print, you put CSS into MediaWiki:Print.css on your wiki.

If enabled on your wiki, individual users can create custom stylesheets just for themselves at special:mypage/<skin_name>.css (for example special:mypage/vector.css if they are using the vector skin).

You can also create custom skins for MediaWiki.

[edit] Help

CSS syntax, attributes and values, must be correct or stuff won't work right. W3.org is an excellent reference for checking how to write CSS correctly:

Wikipedia provides a good overview of CSS, along with links to additional supporting resources.

[edit] Caveats

Some items should not be totally moved into CSS without double checking that they are still accessible to text browser users:

[edit] See also

Language: English  • Français
Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox