Home > OS >  What is the difference between active and is-active?
What is the difference between active and is-active?

Time:12-28

I am learning from a website tutorial and I stumbled across active and is-active in the JS code. I checked the HTML code and those are not classes. Furthermore, they do not start with a dot as classes do. I know that active is a CSS selector, but I have never seen is-active before. Could you please explain that to me? Thank you very much.

CodePudding user response:

There is no is-active css stuff.
For the :active, it is a selector to trigger something when you click on an element. Example: html:

<p>Hello world</p>

css:

p:active {
    color:white;
    background-color:black;
}

This will make the

turn into white color over black background when you click and hold on to it.

CodePudding user response:

In CSS :active is a pseudo-class which is triggered when you click or hold on the html element and there is nothing like is-active in CSS

  • Related