Wikia Developers Wiki

CSS Cookbook

869pages on
this wiki
Add New Page
Talk0 Share

This is a collection of useful CSS to be used however you want.

Page specific CSS

Every page has a unique class that can be used to apply page specific CSS. For example, this page would be:

.page-CSS_Cookbook {

This would make the text of this page black. You can also specify certain parts of specific pages, such as:

.page-CSS_Cookbook a {

This would turn all the links on the page red. If the page is not part of the mainspace, such as a page in the Help namespace, the class alters like this:

.page-Help_CSS_Cookbook a {

Background images

If you want to change the background image of your wiki using CSS, look no further. Generally, you can accomplish this using

body {
background-image: url(<replace this with the url of the image you want the background to be>);
background-color: <changes the color of the background, use a hex code or color name (i.e. "red")>;
background-attachment: <set to scroll to allow it to scroll with the page, or to fixed to keep its position static>;
background-position: <set to either the directions from which to start the image (i.e. "top left", "left center", "right center", etc), percentages (x% y%), or position (xpos ypos). (Note: % and pos are mixable)>
background-repeat: <the default setting is repeating the image both vertically and horizontally, setting to repeat-y will repeat the image only vertically, setting it to repeat-x will repeat it only horizontally, and setting it to no-repeat prevents it from repeating at all.>;

Some fine tuning may be required, but those are the basics.

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.