Reputation: 65
I'm watching Traversy Media's SASS Course, and I've got this problem with my icon colour not applying. Here's my HTML:
Does anyone know why the #fff colour isn't applying to my icons?
.icons a {
color: pink;
margin: 0 0.3rem;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<div class="icons my-1">
<a href="#"><i class="fas fa-globe fa-2x"></i></a>
<a href="#"><i class="fab fa-twitter fa-2x"></i></a>
<a href="#"><i class="fab fa-facebook fa-2x"></i></a>
<a href="#"><i class="fab fa-linkedin fa-2x"></i></a>
<a href="#"><i class="fab fa-instagram fa-2x"></i></a>
</div>
Upvotes: 1
Views: 732
Reputation: 65
I don't know why, but nothing was working out, anyways thanks for your help, I just copy pasted the source code from Traversy Media's YouTube Video which is extremely frustrating but can't be helped! Thanks!!
Upvotes: 0
Reputation: 66
You're applying the color to the surround <a>
tag, to apply the effect to the inner <i>
field you need the following CSS selector:
.icons a i {
color: #fff
}
Otherwise the selector is trying to change the color of the anchor itself, which has no color.
Upvotes: 1
Reputation: 855
You need to apply the color to the element
.icons a i {
color: #fff;
}
Upvotes: 0