Paw*_*wel 11 css safari css3 ios
我在iPhone设备上有一个小的CSS问题.我的搜索输入为蓝色,当用户关注它时,插入符号几乎不可见:
在所有桌面浏览器中,即使在桌面Safari上,它也具有正确的颜色(白色).知道如何修复此问题并更改iOS设备上的插入颜色吗?
输入样式:
input {
background-color: $stateBlue;
height: $navbarItemHeight;
padding: 0 10px;
vertical-align: bottom;
color: $white;
border-radius: $borderRadius;
font-size: 1.1666666667em; // 16px
-moz-appearance:none;
-webkit-appearance:none;
&::-webkit-input-placeholder {
text-shadow: none;
-webkit-text-fill-color: initial;
}
}
Run Code Online (Sandbox Code Playgroud)
有一个称为的W3C规范caret-color,可以这样使用:
input[type="text"].custom {
caret-color: red;
}Run Code Online (Sandbox Code Playgroud)
<div>
<label>default caret:</label>
<input type="text"/>
</div>
<div>
<label>custom red caret:</label>
<input type="text" class="custom"/>
</div>Run Code Online (Sandbox Code Playgroud)
Chrome(也在Android上),Firefox,Opera和Safari(包括iOS)目前都支持它。