Topic on Project:Support desk

Jump to navigation Jump to search

How do I change the color of specific links?

Lieutenant S. Reznov (talkcontribs)

How do I change the color for specific links on a page? I've tried various methods that seem like they should work, but none of them have.

Is there code that can be used on a page to set the color for a specific link?

For example, I want to make the link on this template lighter so that I can make the template itself darker.

This post was posted by Lieutenant S. Reznov, but signed as Inquisitor Ehrenstein.

Allen4names (talkcontribs)

How specific? Use can place the link inside span tags. The wiki-text...

<span class="Uniq1234">[[MediaWiki]]</span>

will produce the link "MediaWiki". You can edit your personal CSS or MediaWiki:common.css to change the link color.

span.Uniq1234 a { color: green; }
Lieutenant S. Reznov (talkcontribs)
Bawolff (talkcontribs)

If you're not an admin (and can't edit common.css) you can also do things like [[foo|<span style="color:green">foo</span>]] to give you foo. If you do have admin access, Allen4names method is probably the best one.

Lieutenant S. Reznov (talkcontribs)
Reply to "How do I change the color of specific links?"