Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Aiheen aloitti: Sir Osis of Liver - lokakuu 18, 2011, 02:44:16 AP

Otsikko: CSS question
Kirjoitti: Sir Osis of Liver - lokakuu 18, 2011, 02:44:16 AP

I'm trying to change the link colors for the quickbuttons above the postarea -



ul.quickbuttons a:link
{
color: #0000FF;
}




Works fine until I add a:visited -



ul.quickbuttons a:link, a:visited
{
color: #0000FF;
}




The color takes effect, but it changes the a:visited color elsewhere on the forum - admin, messages, etc.  Since the color is specific to just this pseudo class, why is it  affecting other areas?

Otsikko: Re: CSS question
Kirjoitti: adela01 - lokakuu 18, 2011, 02:46:23 AP
I also hope the issue concerns all help. Thank you very much.
Otsikko: Re: CSS question
Kirjoitti: Ricky. - lokakuu 18, 2011, 03:45:05 AP
Hey Krash..
I donno what you are trying to achieve but your second snippet should be :
ul.quickbuttons a:link,ul.quickbuttons  a:visited
{
color: #0000FF;
}


Try that and let me know :)
Otsikko: Re: CSS question
Kirjoitti: Antechinus - lokakuu 18, 2011, 03:50:41 AP
Ricky is correct. The way you had it, it definitely would hit every visited link on the page. An attribute after a comma in CSS does not read what comes before the comma. It's code, not a sentence. ;)
Otsikko: Re: CSS question
Kirjoitti: Sir Osis of Liver - lokakuu 18, 2011, 02:57:12 IP

That fixed it, thanks.

One odd thing I found last night, when I deleted all the a:visited styles from index.css, it displayed visited links in an awful purple color (810081) that does not exist in index.css.  How can it display a color that's not in the code?

Otsikko: Re: CSS question
Kirjoitti: Antechinus - lokakuu 18, 2011, 04:17:48 IP
That's default HTML behaviour when no style is specified. God knows why they chose those colours, but they did. Try disabling CSS on a page and you'll see the effect. :).