Help:Styles

From WikiEducator
Jump to: navigation, search
Vista Community Help.png

Using styles


Because Mediawiki is built on standard web technologies, you can apply the standard Cascading Style Sheet (CSS) and Javascript techniques to affect how pages are rendered.

One way to consider the different ways of applying styles is by scope of their application.

Local

You can embed a style= attribute directly in an element on the page. That can be effective if you only want to style a particular element.

Local, but repeated

If you find yourself repeating a particular style, you can move it to a Template.

Page (or set of pages)

If you want to apply a style (or "theme") to a page or collection of pages the WEtheme extension facilitates that. By using the <wetheme... /> tag on a page custom CSS and/or Javascript can be injected.

N.B. Because there are security concerns involved with adding arbitrary CSS or Javascript, these files need to be vetted before application on WikiEducator. For this reason, the ability to add custom themes to pages is limited to OERu partner institutions. As we gain more experience with these features, more of them will migrate to wider use.

Globally

Mediawiki provides global Common.css and Common.js for applying CSS and Javascript that are found to be valuable site-wide.