Firefox PHP

Adding Styles to Classes

Posted by Olof 
Adding Styles to Classes
May 20, 2008 06:22AM
I want to give some parts of my Phorum pages different link colors.
So I tried adding more styles to the existing classes in css.tpl like this:

#phorum div.nav {
    font-size: {font_small};
    margin: 2px 0 2px 0;
    a:link   {color: white;}
    a:visited  {color: white;} 
    a:hover  {color: white;}
    a:active  {color: white;}
}

That does nothing though.

Any advice would be greatly appreciated.
Re: Adding Styles to Classes
May 20, 2008 06:25AM
are you sure that this is valid css?


Thomas Seifert
Re: Adding Styles to Classes
May 20, 2008 09:20AM
I'm rarely sure about anything. ;) Are you saying it's not?
Re: Adding Styles to Classes
May 20, 2008 09:41AM
He didn't know for sure (I asked him the same), because he was not a "CSS god" as he put it himself in the chat. I, on the other hand, am a CSS god and can tell you that these kind of nested style definitions are not possible in CSS. I think you were trying to write down the following (without looking at the template code to see if this would actually change the nav link colors):
#phorum div.nav {
    font-size: {font_small};
    margin: 2px 0 2px 0;
}

#phorum div.nav a:link,
#phorum div.nav a:visited,
#phorum div.nav a:hover,
#phorum div.nav a:active {
    color: white;
}


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce



Edited 1 time(s). Last edit at 05/20/2008 09:42AM by Maurice Makaay.
Re: Adding Styles to Classes
May 20, 2008 10:14AM
Hey, that actually works!
I'll try to understand why it does later, when I got some sleep.

Great, that opens some very elegant new ways to integrate Phorum in my site design.

Thanks a lot to the CSS God, I'll sacrifice my neighbor's firstborn to you!
Re: Adding Styles to Classes
May 20, 2008 10:34AM
It's not that hard. You just cannot nest the CSS definitions.
Read up on "CSS selectors" to get some more info on this subject.

And thanks for the sacrifice.
It is highly appreciated.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login