CSS difference between . and : plus How can I make a div fixed while another div is fixed

Issue

This Content is from Stack Overflow. Question asked by Larsco Rubin

So basically I have two questions.
First question: I have found this codepen : https://codepen.io/WebDevSimplified/pen/LqKQRK
It makes no sense to me why .active and not :active? When I change it with : is not working at all.

.navbar-links.active {
      display: flex;
      color: transparent;
  }  ```

Second question: Is it possible to make a div fixed while another div is active?
Thanks



Solution

This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?