skip to Main Content

I want to change color of all a tags with the help of banner class. Can I do that in CSS?

<div class="banner">
  <a href="">MxForm</a>
  <a href="">antiX Forum</a>
  <a href="">contributes</a>
</div>
.banner {
  background-color: #114653;
  color: white;
}

2

Answers


  1. To change color of all a elements, you can try like this:

    .banner {
        background-color: #114653;
        color: white;
    
        a {
            color: red;
        }
    }
    
    Login or Signup to reply.
  2. .banner > a { color: red; }

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search