【问题标题】:CSS - Sibling selector not working in android?CSS - 兄弟选择器在 android 中不起作用?
【发布时间】:2013-03-04 08:31:53
【问题描述】:

此代码在桌面版 Chrome 中运行良好,但在 android 库存浏览器中运行良好:

<!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>

基本上,当您单击 hte 复选标记时,span 标记文本应变为红色。安卓 4.0 的 Galaxy Note 上没有变红。

我的代码有什么问题?

【问题讨论】:

    标签: android css siblings


    【解决方案1】:

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

    支持兄弟选择器

    :checked 伪类不是

    【讨论】:

    • 好吧,这是有道理的。你知道我可以使用哪个css规则来获取android中的所有选中复选框吗? input[checked="checked"] 没有给我任何东西。
    • 似乎有一些技巧可以奏效。 check this out 和/或试试这个 input[type=checkbox]:checked
    • css 技巧论坛已移动 - 新网址为:css-tricks.com/forums/topic/checkbox-hack-on-mobile-webkit
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-08-02
    • 2011-12-13
    • 1970-01-01
    • 2014-04-23
    • 2014-02-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多