webkit的时间字段的伪元素 [英] webkit css pseudo elements for time field

查看:134
本文介绍了webkit的时间字段的伪元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里找到了一篇关于webkit伪元素的有趣文章,因此我需要移除从输入类型=时间取消按钮,但是通过murthy定律,这个伪元素不在任何地方描述。如果有人知道,请张贴我。

I found an interesting post about webkit pseudo elements for inputs here, so I needed to remove cancel button from input type="time", but by murthy's law exactly this pseudo element not described anywhere. If someone knows please post me.

我已经尝试了

::-webkit-search-cancel-button
::-webkit-input-cancel-button 
::-webkit-time-cancel-button
::-webkit-time-cancel-button

当然还有一种方法可以用:after 元素后,但我不相信这个



Of course there is a way to do this with :after element, but I don't believe there are no pseudo element for this

input[type="time"]::after
{
    content: "";
    background: #FFF;
    height: 20px;
    width: 10px;
    position: absolute;
    margin: 0 -10px;
}


推荐答案

$ c> :: - webkit-clear-button

That would be ::-webkit-clear-button

所以使用

input[type="time"]::-webkit-clear-button{
    display:none;
}

要查找此类内容,您可以启用

To find such things you can enable Show Shadow DOM from the console options, under Elements.

输入元素,你可以打开它,看看下面。

This way when you select the input element, you can open it and look under the hood..

这篇关于webkit的时间字段的伪元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆