- This topic has 9 replies, 3 voices, and was last updated 3 years, 4 months ago by
David.
-
AuthorPosts
-
December 4, 2022 at 9:08 pm #2449699
Jodie
Hi,
I’d like to have some of the links on my site (the important ones) a different color to the rest of the links.
What’s the best way to do this please?
Thanks for your help!
Cheers Jodie
December 4, 2022 at 10:29 pm #2449753Fernando Customer Support
Hi Jodie,
For reference, can you give a couple of examples of “important” links you wish to alter the color of?
The best way I’m thinking right now is through custom CSS targeting a specific custom class.
December 4, 2022 at 11:14 pm #2449794Jodie
Hi Fernando
Thank you.
Sure thing. I’ve attached some examples.December 5, 2022 at 12:01 am #2449820Fernando Customer Support
I see. If that’s the case, can you try using the Highlight feature of WordPress? Example: https://share.getcloudapp.com/p9uLzqRj
December 5, 2022 at 12:22 am #2449829Jodie
Thanks so much Fernando
I’ve had a go at using that feature but the underline color of green and hover color of purple are the same as our current link styles.
Is there any way to change the underline color and hover color of the underline for the links we choose to be another color?
I’ve attached a screenshot
As always I appreciate your help.December 5, 2022 at 12:49 am #2449853Fernando Customer Support
I see. There’s a way.
We can you the “highlight” feature as a determinant of “important” links.
Then, you can add this CSS through Appearance > Customize > Additional CSS:
.entry-content p a:not(:empty) { color: #ff0000; } .entry-content p a:not(:empty):hover mark { color: #ff00ff !important; }You can alter the color values to your preference.
December 5, 2022 at 2:24 am #2449933Jodie
Thanks very much Fernando
Is there a way to do this using a CSS Class? I am just thinking that sometimes I use the highlight feature to change links to white text as it is hard to see the green text on a purple background.
Would using the above CSS change all the links that I already have highlighted on the site?December 5, 2022 at 5:06 am #2450137David
StaffCustomer SupportHi there,
if you want to style a specific link in your content using an additonal CSS class then:
1. Add this CSS:
.entry-content .my-custom-link a { color: #ff0000 !important; } .entry-content .my-custom-link a:hover { color: #00ffff !important; }2. Select the block in the editor and give it an Advanced > Addtional CSS Class of
my-custom-linkChange the
my-custom-linkclass to whatever you require.December 5, 2022 at 6:48 pm #2451004Jodie
Thanks so much David.
I will try what you’ve recommended above.
Cheers Jodie
December 6, 2022 at 3:18 am #2451306David
StaffCustomer SupportYou’re welcome
-
AuthorPosts
- You must be logged in to reply to this topic.