I recently added some CSS to give a unique style of underlining to hyperlinks in my blog posts. I was successful in ensuring that the CSS only affected the text within the body of my posts and not the headers or footers. However, I encountered an issue where the links in my sidebar were also getting the same underlining effect, which was not desired. Both text and images with links in the sidebar were being affected.
Can anyone provide guidance on either 1) altering the CSS so it exclusively modifies the text in the blog posts or 2) excluding the sidebar from this specific CSS?
body.single.single-post .site-content a {
box-shadow: inset 0 -0.4rem #EE841B8F
}
For a live example, visit:
I attempted to use "not" in the CSS, but it didn't seem to have the intended effect (or at least, not in the way I had hoped).