开发者

CSS3 Selector Problem

开发者 https://www.devze.com 2023-02-19 13:14 出处:网络
I can`t find out why this workes: input[ type = \"text\" ]:last-of-type:focus{ border:1px solid red; }

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消