Forum:Defining a color to use on text

Hello everyone. I have a twofold question today about text color.

First of all I'd like to know how I can define colors Wiki-wide when called upon. You know how you can user class="color1" in a box to inherit the button color for its background? I want to know if there's a way to define more colors that can be called upon similarly.

My second question is, if the former is possible, how could I use this to change the color of certain text (obvious a hypothetical style="color:color3;" won't work).

The reason I'd like to know this is because I'd like to set the text of the top and secondary titles on infoboxes (such as this one) on the Wiki I work on to inherit the color from another location so I can easily change text color on all of them with one edit in the future.

If anyone can help, I'd much appreciate it.-Revitalizer (talk) 01:13, December 10, 2012 (UTC)


 * You could template the color:


 * lorem ipsum


 * Not the most elegant solution. But it would work. --


 * If the class of every table header you want to change the color of its content is "color1", as in the one you linked to, just add this line in your MediaWik:Common.css page

.color1 { color: whateveryouwant; }
 * Or, you could make it through the template, by having it take a color as a parameter, but this will make use of inline styles (as in style="...") which is not really best practice, and should be avoided when possible, like in this case. -- Noemo n  * talk * 01:27, December 10, 2012 (UTC)