Link color
-
Hello,
The default link color in postst for my theme I believe is red. I have been playing with theese code in order to make it blue. The problem is that they start to affect other stuff like menu items.
please help me figure it out
The css code that is added now :/* unvisited link */
a:link {
color: #3b5998;
}
/* visited link */
a:visited {
color: #3b5998;
}
/* mouse over link */
a:hover {
color: #3b5998;
}
/* selected link */
a:active {
color: #3b5998;
}The blog I need help with is: (visible only to logged in users)
-
-
Thank you verry much for your help Terry. But what i need is a code that can change the color of a link to a website that i insert in a post to be blue instead of red. Right now it is red.
The only way I managed to make it blue is with that css. The problem is that it affects a lot of other things, and i do not want that :) -
Hi!
All sites typically have a global a:link color. To modify a specific link’s color, you need to isolate it from the rest. You can do this what’s known as ‘inline’ coding
<a href='http://example.com' style='color:green'>Example.com</a>which is ok for one or two links, or better yet, use a class..
<a href='http://example.com' class='customlinks'>Example.com</a>
then update your Custom CSS...customlinks{ color: green; }Give that a try and let me know how you go!
-
This how the code i inserted looks.
.customlinks{
color: green;
}And it is not working :(
-
-
-
I only see the one link..
<a href="http://www.thesanitysnack.com">www.thesanitysnack.com</a>To have a unique color for that link, in your editor switch to ‘HTML’ and add the class to the link, like this, and save.
<a href="http://www.thesanitysnack.com" class ="customlinks">www.thesanitysnack.com</a> -
The main color setting for links is the following. Add this to your custom CSS and edit the color as desired.
a, a:visited { color: green; }If you also want to change the hover color, you can add this and edit the color.
a:hover, a:focus, a:active { color: blue; } -
@thesacredpath, thank you.
The only problem now is that the social media menu is affected by the code.
-
Hi, I’m not seeing any issue on the social menu at the bottom of your site. We can however get more specific and target just the links in the content area. Replace the code I had given with the following.
.entry-content a, .entry-content a:visited { color:green } .entry-content a:hover, .entry-content a:focus, .entry-content a:active { color:blue } -
My bad, I did not saved and publish the first code I inserted, but the social media menu was blue :). However the second one worked like a charm.
Thank you verry much.
-
- The topic ‘Link color’ is closed to new replies.