In Chrome and Safari, if we specify initial for an inheritable CSS property, it will select the initial value.
But if we specify initial for an inheritable CSS property in FireFox, IE, or Opera, it will reject that value assignment altogether.
Which is the correct behavior here?
<!doctype html>
<div style="color:red;">1111
<div id="d2" style="color:blue;color:initial;">2222</div>
</div>
<script>
document.write(document.getElementById("d2").style.color);
</script>
The
initialvalue seems to be valid.As CSS3 is (relatively) new and still prone to change, I suspect that not all browsers are up-to-date with the standardisation.
As stated by Paul D. Waite: it is part of the standard to have multiple definitions of the same property, of which the last one shoud win. So according to the standards your example, the color property of
#d2should have the initial value, which is red. Browsers which show the blue color do not support the standard completely/properly.