Skip to main content
Inspiring
6月 17, 2019 1:22 午後 UTC
質問

make font color exceptions in footer

Hi,

If the bulk of the fonts in footer are a specific color, but I'd like to make some in yet another color... how can I achieve this?

I have unique ID for the fonts I want in alternative color, but they are not applying. Not sure what else. They're font awesome icons.

#socialIconID {

    color: #57b6e5;

    font-size: 38px;

    margin-left: -90px;

}

#socialIconID a {

    color: #57b6e5;

    }

#socialIconID a:hover {

    color: #3254bc;

    }

#socialIconID a:active {

    color: #5e32bc;

    }   

#socialIconID a:focus {

    color: #5e32bc;

    text-shadow: 1px 1px 1px #ccc;

    }     

.faStyle {

   

    display: inline-block;

    font-family: FontAwesome;

    font-size: 32px;

    font-style: normal;

    font-weight: normal;

    line-height: 1;

    -webkit-font-smoothing: antialiased;

}

.fab {font-family: "Font Awesome 5 Brands";}

HTML

<div class="social">

   <div id=socialIconID">

          <a href="">
<i class="fab faStyle fa-linkedin" aria-hidden="true"></i>

Do I need to apply socialIconID to the 'i' tag or the 'a' tag?

このトピックへの返信は締め切られました。

返信数 4

John Waller
Community Expert
Community Expert
6月 17, 2019 9:53 午後 UTC

I have unique ID for the fonts I want in alternative color, but they are not applying.

What is not applying exactly? Can you show us the full page code?

Even better, a link to the page showing the issue you're trying to solve.

翻訳
Nancy OShea
Community Expert
Community Expert
6月 17, 2019 6:42 午後 UTC

Linked text gets its colors from the link pseudo-classes

a { }

a:link { }

a:visited { }

a:hover, a:active, a:focus { }

If you want to be more specific than that, use an anchor class.

footer a.red{ color:red}

footer a.magenta {color:magenta}

<footer>

<a class="red" href="#">Red link</a>

<a class="magenta" href="#">Magenta link</a>

</footer>

翻訳
Nancy O'Shea— Product User & Community Expert
r_tist作成者
Inspiring
6月 18, 2019 5:59 午後 UTC

OK, when I added ':link' next to the @socialIconID a { ....the correct color applied.

Why is my hover state color not applying?

#socialIconID a:hover {

    color: #3254bc;

    }

翻訳
Nancy OShea
Community Expert
Community Expert
6月 18, 2019 9:45 午後 UTC

You're asking more questions and not providng much information.  What does "not working" mean?  As John said, for quickest answers post the URL to your problem page online so we're all on the same page.  Otherwise, it's just guesses.

翻訳
Nancy O'Shea— Product User & Community Expert