2017-06-29 115 views
-3

我有我的页面中输入日期类型的输入,我想改变其中的高光颜色,我不知道是否有CSS选择器。Html Css更改日期输入突出显示颜色

这里就是我在谈论的图像:

enter image description here

谢谢您的关注! :)

编辑

这里就是我想要做的事:

enter image description here TO enter image description here

+0

下的[更改文本高亮颜色(https://stackoverflow.com/questions/37095442/change-textbox-highlight-color) – jimboweb

+0

可能的复制@jimboweb这不是一回事。这篇文章讨论边界焦点颜色,但这里我正在谈论文本高亮颜色 – alexandre

+0

只需使用背景颜色即可。不难想象出来 – user5014677

回答

1

可能会有所帮助,改变了bootstrap.css以下的CSS项

textarea:focus, 
 
input[type="text"]:focus, 
 
input[type="password"]:focus, 
 
input[type="datetime"]:focus, 
 
input[type="datetime-local"]:focus, 
 
input[type="date"]:focus, 
 
input[type="month"]:focus, 
 
input[type="time"]:focus, 
 
input[type="week"]:focus, 
 
input[type="number"]:focus, 
 
input[type="email"]:focus, 
 
input[type="url"]:focus, 
 
input[type="search"]:focus, 
 
input[type="tel"]:focus, 
 
input[type="color"]:focus, 
 
.uneditable-input:focus { 
 
    border-color: rgba(126, 239, 104, 0.8); 
 
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(126, 239, 104, 0.6); 
 
    outline: 0 none; 
 
}

0

我把我的日期输入作为文本框so :: selection可以在它上面工作。这在Chrome和Edge中适用于我,但是我注意到当与-moz结合使用时,它停止工作。

<style> 
    #myInput { 
     color: rgb(0, 255, 144); 
    } 
    #myInput::selection { 
     background-color: rgba(248, 90, 192, 0.56); 
    } 
    #myInput::-moz-selection { 
     background-color: rgba(248, 90, 192, 0.56); 
    } 
</style> 

<div class="row"> 
    <input type="text" id="myInput" value="Test input text" /> 
</div>