IRGeekSauce IRGeekSauce - 4 months ago 6
HTML Question

Link style not setting for all links in CSS

I'm slowly learning html/css. I have a client that wants 3 links on the page to be noticeable link colors (in this case, blue). However, when I try to edit the style of the links, only two of them are showing the changes.

URL Links

I can't set it globally, or other links (such as some social media icons) are changing.

Here is what I've tried:

div.entry-content a:link {
color: blue;
}

entry-content a:link {
color: blue;
}


Here is what I'm looking at when I inspect the page:

Inspect Element

So, where am I going wrong? I hope I added everything needed for assistance. Thanks.

Answer

I'm assuming all three links are wrapped in in div with class entry-content. The only thing I can think of is that the first link is black or darker color because it's active or visited. You can style your links with just a selector or with additional pseudo selectors.

/* Just a selector */
.entry-content a {
    color: blue;
}

/* Just a selector */
.entry-content a,
.entry-content a:visited,
.entry-content a:active {
    color: blue;
}