In writing some html, I was too lazy to decide a more specific CSS selector like this:
#z {
transition-duration:0s;
transition-delay:1s;
}
So I had chosen the *
selector instead.
I was surprised with the result of this code. Try it:
* {
transition-duration: 0s;
transition-delay: .5s;
}
#z {
color: red;
background-color: white;
}
#z:hover {
color: white;
background-color: red;
}
<html>
<body>
<div id="z">
<span>mouse hover here!</span>
</div>
</body>
</html>
In my browser, transitions take effect in two steps: background-color
changes after a 1s delay, followed by the change of color
after another 1s delay.
If I switch back from the *
selector to a more specific selector, transitions will be simultaneous. Is it browser specific? What is the relevant rule for this result?
EDIT: 1(question rephrased) Is there any specification made by CSS that every browser should follow to implement in this way(as described above), or this is up to browser or even hardware performance? 2\ I've tried it on Chrome, and a browser on an android mobile phone (a touch for a hover). Both produce the same result.