My CSS skills are limited, so I am facing what may seem like a basic issue.
On my website, I have a table of contents with links structured like this:
<a href="#user-interface">User interface</a>
Additionally, there is a bookmark in another section coded like this:
<a name="user-interface">User Interface</a>
Furthermore, the CSS file contains the following style rule:
a:hover
{
color:#D090D0;
background:#803080;
text-decoration:none;
}
The objective here is to alter the color and background of the link upon hovering, which is functioning correctly. However, an issue arises where the bookmarks also adopt this styling behavior when hovered over. This makes sense as both the link and bookmark utilize the <a>
tag, making it difficult for me to differentiate between them in the CSS. While assigning a class to the link is one solution, I am curious if there might be a more optimal approach.