使用 pseudo 类 来选择 webkit 伪元素
Use pseudo classes for selecting webkit pseudo elements
不确定标题是否清楚。
我尝试做的是 select 一个带有 :nth-of-type
pseudo [=] 的 webkit pseudo 元素(在阴影 dom 内) 36=].
所以我想 select -webkit-datetime-edit-text
pseudo 元素 input
.
我以为我可以这样做:
::-webkit-datetime-edit-text:nth-of-type(2){
display: none;
}
但这行不通。
有办法吗?
将不胜感激。
ps:对于那些不知道检查阴影的可能性的人 dom 请参阅 here point nr 12。
这是完整的破解时间!!!
要获得真正的解决方案,请按您的方式进行。但无论如何,使用特定于供应商的伪元素意味着你对黑客持开放态度,不是吗?
不幸的是,似乎没有任何方法可以在伪元素上组合伪选择器。
但是在尝试一些东西和其他东西时,我最终遇到了这个可怕的黑客:
这一秒之前的元素 :
可以作为目标。所以我们可以放在真正的目标之上,背景是白色,假装这个:
不存在。
input::-webkit-datetime-edit-fields-wrapper {
position: relative;
}
input::-webkit-datetime-edit-text {
position: relative;
z-index: 0;
padding-right: 4px;
}
input::-webkit-datetime-edit-minute-field {
background: white;
z-index: 4;
display: inline-block;
width: 10px;
height: 12px;
position: absolute;
top: 0;
margin-left: -4px;
}
<input type=time step="1" value="00:00:00">
不确定标题是否清楚。
我尝试做的是 select 一个带有 :nth-of-type
pseudo [=] 的 webkit pseudo 元素(在阴影 dom 内) 36=].
所以我想 select -webkit-datetime-edit-text
pseudo 元素 input
.
我以为我可以这样做:
::-webkit-datetime-edit-text:nth-of-type(2){
display: none;
}
但这行不通。
有办法吗?
将不胜感激。
ps:对于那些不知道检查阴影的可能性的人 dom 请参阅 here point nr 12。
这是完整的破解时间!!!
要获得真正的解决方案,请按您的方式进行。但无论如何,使用特定于供应商的伪元素意味着你对黑客持开放态度,不是吗?
不幸的是,似乎没有任何方法可以在伪元素上组合伪选择器。 但是在尝试一些东西和其他东西时,我最终遇到了这个可怕的黑客:
这一秒之前的元素 :
可以作为目标。所以我们可以放在真正的目标之上,背景是白色,假装这个:
不存在。
input::-webkit-datetime-edit-fields-wrapper {
position: relative;
}
input::-webkit-datetime-edit-text {
position: relative;
z-index: 0;
padding-right: 4px;
}
input::-webkit-datetime-edit-minute-field {
background: white;
z-index: 4;
display: inline-block;
width: 10px;
height: 12px;
position: absolute;
top: 0;
margin-left: -4px;
}
<input type=time step="1" value="00:00:00">