最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

css - How to change hover link colour for blog post (body) text only

programmeradmin3浏览0评论

I am using the Shamrock theme and I am happy with link colours on the main page however when you go into a blog post and hover over any links within the body they are red.

I have tried multiple things with CSS (after hours of googling as I do not know CSS) and without using !important and therefore changing ALL links I can't get just the links within the blog posts to change when hovering over them.

Is anyone able to help with this, please?

I am using the Shamrock theme and I am happy with link colours on the main page however when you go into a blog post and hover over any links within the body they are red.

I have tried multiple things with CSS (after hours of googling as I do not know CSS) and without using !important and therefore changing ALL links I can't get just the links within the blog posts to change when hovering over them.

Is anyone able to help with this, please?

Share Improve this question asked May 4, 2020 at 19:29 chxrlotterosechxrlotterose 11 bronze badge 1
  • I would like the links to be this colour when hovering, #e164af – chxrlotterose Commented May 4, 2020 at 19:30
Add a comment  | 

3 Answers 3

Reset to default 0

Found the answer! For anyone else with the this question, this worked for me:

.entry-content a:not(.more-link):not(.wp-block-button__link):hover {
    color: blue;
}

Change colour for one you prefer :)

You can use the page ID then set the class to reflect it.

For example:

body.page-id-1,body.page-id-2,body.page-id-3 {
     background-color: green !important;
}

You can use the body class to nesting each anchor tag.

This is for the blog post page:

.blog a:hover {
    color: #e164af;
}

And, this is for the blog post detail pages:

.single a:hover {
    color: #e164af;
}
发布评论

评论列表(0)

  1. 暂无评论