Templates Wiki
Forums: Index Help desk How to change link color in a template
Note: This topic has been unedited for 238 days. It is considered archived - the discussion is over. Information in this thread may be out of date. Do not add to unless it really needs a response.


My problem[]

I'd like to include links with the [[link]] notation in my templates, but sometimes I run into visual contrast issues with my background colors. I can't see a way to include CSS styles in a <style> tag. (I tried.)

Is there a way I can adjust link color so my templates stay readable when I add links?

~ MissLunaRose (talk) 00:02, 1 December 2024 (UTC)

Update: My solution[]

The only way I've found to adjust link colors is by accessing the wiki's custom CSS. This requires Admin Dashboard privileges. Then you access both desktop and mobile CSS to add classes like:

.black-links a { color: black; }

Once these are added, you have classes ready to go. You add your new class to any parent container (e.g. class="black-links") and the style will be applied.

For example, the autism userbox on the Autism Wellbeing Wiki uses the navy-links class to control link color. Whether you're in dark mode or light mode, the link is the same color, preserving link readability.

More detail on this, including instructions, is in this blog post.

~ MissLunaRose (talk) 19:54, 21 June 2025 (UTC)

Out of date[]

Users can now add full styles to their templates thanks to the TemplateStyles feature. See CSS per template (Community Central. Muchos latest (talk) 23:48, 21 June 2025 (UTC)