CSS3 Selector Problem
I can`t find out why this workes:
input[ type = "text" ]:last-of-type:focus{ border:1px solid red; }
but this doesn`t work:
input[ type = "checkbox" ]:last-of-type:checked{ border:1px solid red; }
The "border" property is just an example, any other properties i开发者_Go百科s also, dismissed!
Given:
<!DOCTYPE HTML>
<meta charset="utf-8"/>
<title>Testing</title>
<style>
input[ type = "checkbox" ]:last-of-type:checked{ top: 100px; }
input[type='checkbox'] { position: absolute; top: 200px; }
</style>
<h1>Testing</h1>
<form>
<input type="submit" />
<input type="checkbox" />
</form>
It works perfectly in Chrome for me. Presumably you didn't try it with any properties that are respected on checkboxes in the browsers you were testing in.
精彩评论