CSS - Selector selector not working in android?

This code works fine in Chrome on the desktop, but not in the Android browser:

<!DOCTYPE html>
<html>
<head>
<style type="text/css">
input:checked ~ span {color:red;}
</style>
</head>
<body>
<label>
<input type="checkbox" />
<span>First item</span>
</label>
</body>
</html>

Basically, when you click the hte checkmark, the span tag text should be red. It does not turn red on my Galaxy Note with Android 4.0.

What is wrong with my code?

+5
source share
1 answer

http://quirksmode.org/css/selectors/mobile.html

Sibling selector supported

: proven pseudo-class not

+8
source

All Articles