# How do I change the color of a hyperlink?

When I create a hyperlink in a notebook, the text is blue, like the user defined variables. (Any word in the title like Graph which is a M function is in black.) How can I change the color to something else, e.g. red? Everything I've tried so far, in the Option Inspector, or by editing the cell expression has not worked. I'm new to M and have only modest programming skills and might be missing something obvious. I have M10.2 on Windows 7.

• Is this ok too? Hyperlink["www.google.com", BaseStyle -> Red]? – Kuba Dec 14 '15 at 21:25
• @Kuba. This will work if you start the link with http:// – MPR Dec 15 '15 at 16:12
• It didn't work for me unless I had the the prefix. @Kuba – MPR Dec 15 '15 at 16:16
• Your solution is the simplest for a basic solution. – MPR Dec 15 '15 at 16:20
• Let's assume Hyperlink["http://www.google.com", BaseStyle -> Red], what limitations are there? – Kuba Dec 15 '15 at 16:21

You can change the style of a hyperlink in your notebook by modifying its stylesheet.

1. Open the Format>Edit stylesheet... menu. Private definitions stylesheet opens.
2. Click on the blue "Default.nb" link. Default stylesheet opens.
3. In the notebook that opens click on the blue "Core.nb". Core stylesheet opens
4. Search for (using the Find dialog) for Hyperlink
5. Copy the appropriate cell found this way to the first sheet that opened and change its style using the Format menu

In pictures:

A hyperlink in a notebook

Step 1

Step 2

Step 3 & 4

Step 5

Result is visible immediately

Done.

• The comments above and below are good for a simple link to a web site or the top of another notebook. To get to a tagged cell somewhere in another notebook, I had to create the link as shown here and then use the Insert->Hyperlink menu to get to the target cell. At that point, I can tweak the appearance – MPR Dec 15 '15 at 16:29

I you only want to have a custom style for one particular hyperlink, you can just write it as a Hyperlink call.

For example,

Hyperlink["Link: Mathematica.SE",
"http://mathematica.stackexchange.com/q/76971/3066",
BaseStyle -> {"Subsubsection"},
ActiveStyle -> {Gray}]


Evaluate this and then hide or delete the code cell. (I prefer hiding.) Depending on your current stylesheet, you should see something like

when the link is inactive and

when the link is active (mouse cursor is over link).