• Welcome to NIWA Community Forums.
 

Creating new Classes?

Started by embyr_75, September 03, 2013, 06:37:00 PM

Previous topic - Next topic

embyr_75

Hey Wiki People,

I'm trying to replace some old content on Metroid Wiki's front page and need to know how to create a new class.

If you look at the main page, you'll notice there are several "semi-transparent" images (one in the "news" box, and one in the "featured article" box). I believe these are implemented using a class="namehere", and I don't know how to reproduce it for the latest feature.

Hate to be a bother with my wiki illiteracy, but I'm impatient and my code-savvy admins are busy people.  ::)

Tucayo

#1
I'm not exactly code-savvy, but I think I can help you here.

By viewing the source of the Main Page you can see each box has its own class ("news", for example, is the class of the News box). If you go to MediaWiki:Common.css, you'll see the classes are listed here; here's what "news" says:

.news {
  background-image:url('http://cdn.wikimg.net/metroidwiki/images/f/fb/News_mainpage.png');
  background-repeat:no-repeat;
  background-position: center center;}


If you want to create a new class for a new feature, all you'd have to do is something like this:

.<class name here>{
  background-image:url('<background image here>');
  background-repeat:no-repeat;
  background-position: center center;}


I believe the images themselves are made semi-transparent beforehand.

embyr_75

AHA! Most excellent!  ;D Thanks so much! That should work perfectly.

... I really need to learn to start figuring out this MediaWiki stuff myself.  :-[

KidIcarus

I'm curious now... what kind of classes are you thinking of making?