Can a CSS be built to affect only to specified page(s)?
Can a CSS be built to affect only to specified page(s)?
The body element of each article has a class name of page-Name_Of_Page, which can be used as a selector. For instance:
/* example for a single page */ body.page-Aqua a { /* affect all links in the article [[Aqua]] */ /* styling goes here */ } /* example for multi-page */ body.page-Penguin_Style a, body.page-Christmas_Party_2008 a, body.page-Walrus a { /* affect all links in the articles [[Penguin Style]], [[Christmas Party 2008]] and [[Walrus]] */ /* styling goes here */ }
Note, however, that special characters (such as :, & and !) are not listed this way- it only covers the alphabet of the wiki's language, as well as digits and a - sign. If that ever becomes a barrier for you, you could use some JavaScript to check the wgPageName
of the given article to determin whether or not to style the page. Though issues of this sort are unlikely to happen.
Does this apply to User, Message Wall and Template?
Yes, but instead of the : after the namespace, there is an underscore.