0

If I apply more than one Pseudo element/class into a single element, it is important to define (write code for one) before the other for working on both/all elements.

    a:link{
    color: cyan;
          }
    a:visited{
    color:orange;
             }

    a:active{
    color:yellow;
            }
    a:hover{
    text-decoration:none;
    font-size:1.4rem;
           }
Apurv Roy
  • 11
  • 4
  • 1
    https://www.456bereastreet.com/archive/200811/the_order_of_link_pseudo-classes_matters/ – 04FS Jul 03 '19 at 07:09
  • But changing the order does not change anything on web page all the properties works absolutely fine that's why i asked this. – Apurv Roy Jul 04 '19 at 07:29

1 Answers1

0

Yes! the order matters. As per docs -

a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective! a:active MUST come after a:hover in the CSS definition in order to be effective!

Uday Vunnam
  • 337
  • 2
  • 5
  • but when i change the order by taking a:hover first and then all other classes for the same element the code works exactly same! – Apurv Roy Jul 03 '19 at 14:24