After setting the default style for all links on my site, I realized that I wanted a different style for links in the sidebar.
In the sidebar section, I added the following HTML:
<div class="toppost">
<p><a href="https:" rel="attachment noopener wp-att-222">Title 1</a></p>
<p><a href="https://" rel="attachment noopener wp-att-222">Title 2</a></p>
</div>
In my CSS file, I included the following code:
.toppost p {
background-color: #ffc531;
}
.toppost:hover p {
color: #ffc531 ;
background-color: #000 ;
text-decoration: underline ;
}
However, when viewing the sidebar, only part of the background color changes according to the CSS rules, while the link retains the default color set for the entire site.
I have a basic understanding of CSS and HTML, and I hope I've explained this issue clearly. If you have any suggestions on how to remove the default link styling just for this particular section on the site, please share your insights. Any help would be greatly appreciated.
Thank you!