Admin Forum:How to add color to infoboxes?

Forums: Admin Central Index → General Questions → How to add color to infoboxes? Wikia's forums are a place for the community to help other members. To contact staff directly or to report bugs, please use Special:Contact.

Hopefully I'm doing this right. I haven't asked a question yet, but there is plenty I need help with.

I am the only active admin at the Mountain Dew Wiki, and one of the few active members in general. I've recently started adding infoboxes the pages regarding the many flavors of Mountain Dew, and I was hoping there was a way I can change the color of the infobox to match that of the flavor. Here is an example of a flavor page with an infobox.

Is there anyway you could show me on here? That way I could easily do in the future. Trainmaster718 07:37, December 5, 2011 (UTC)


 * You need to edit your infobox template, to make the background/header color as a variable that can be assigned.


 * You currently have:

{| class="infobox" style="font-size:89%; width:300px; background-color:#FFF;" ! colspan="2" style="background-color:#3366CC; color:#FFFFFF; font-size:120%; padding:1em;" |
 * So you can change that to

{| class="infobox" style="font-size:89%; width:300px; background-color:#; " ! colspan="2" style="background-color:#; color:#; font-size:120%; padding:1em;" |
 * Then "background_color=xyz" will change the color of the infobox background to any 24-bit hex color you want
 * similarly for the other four.
 * "text_color" for infobox text color
 * "header_text_color" for the headerbar text color
 * "header_background_color" for the headerbar background color
 * ForestMonthZero 10:07, December 5, 2011 (UTC)


 * For a more semantic solution, you can use a  for   that will pick the color for you based on what the title of the page is. You can even merge that into the above so that it can be overridden with , like this:

 {| class="infobox" style="font-size:89%; width:300px; background-color:; color:;" ! colspan="2" style="background-color:; color:; font-size:120%; padding:1em;" |
 * You can replace  and   with actual flavors, and add more as necessary. As a side note, it's also best to not hardcode the   in the style rule, because this allows the user to specify a semantic color such as red or orange, like I did above.