Adjusting the colour of links within just posts
-
Hello all,
How do I change the colour of URLs within the posts alone? I wish to keep my permalink and the links within my widgets black, but I want the SEO-friendly outbound links (and links to other articles) within the articles to be blue.
Any help would be appreciated!
Mod
Use this code in your child theme style sheet or custom css:
.entry-content a {style elements}
.entry-content a:visited {style elements}Done. Thanks Kenneth!
Hmm… I notice that the colours of the links in the A-Z index have also changed, which is unsurprising but not desirable. Is it possible to exclude a page from this change?
Mod
Do you mean this page: http://www.yourfinancialaidoffice.com/articles-list/
In that case, the class of that page is
.page-id-4
So you can use the
not
pseudo class, like this:.entry-content a, .entry-content a:not(.page-id-4) {style elements}
.entry-content a:visited {style elements}Unfortunately, I don’t know that you can combine pseudo classes, so either you’re stuck with your visited link color on that page, or you’ll have to do everything like this:
.entry-content a {style elements}
.entry-content a:visited {style elements}
.page-id-4 .entry-content a {style elements}
.page-id-4 .entry-content a:visited {style elements}The advantage of using the
not
pseudo class is that everything on that page will just use standard formatting, and you won’t have to redefine the styles for just that page, as you have to with the second method.Thanks Kenneth. Using the second option, my inner page links are now blue whilst the A-Z page links are black, as desired. I don’t know what you mean about redefining the styles, but option #2 seems to work without inconsistencies.
Viewing 6 posts - 1 through 6 (of 6 total)
- You must be logged in to reply to this topic.