Richard Richard - 3 months ago 9
HTML Question

CSS how to change the color of a link within a class

I have parts of my webpage what has a dark background, what I want is that just in that part the links are white, but I tried several things, it still is the darker color

css

.transback {
background: rgba(7, 7, 7, 0.7);
}
.transback a:{
color:white}


HTML

<div class="pure-u-14-24 transback">
<a href="../gastenboek_bladeren.html">click here</a>
</div>

Answer

Remove the colon after a in your CSS, it is not a valid selector. You can target a or a:link a:visited a:hover a:active but not a:

.transback {
  background: rgba(7, 7, 7, 0.7); 
}
  .transback a {
    color:white
  }
<div class="pure-u-14-24 transback">
    <a href="../gastenboek_bladeren.html">click here</a>
</div>