在iOS上禁用输入文字颜色 [英] Disabled input text color on iOS

查看:55
本文介绍了在iOS上禁用输入文字颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的简单HTML在基于Firefox和基于WebKit的浏览器中的显示方式有所不同(我在Safari,Chrome和iPhone中进行了检查).

The simple HTML below displays differently in Firefox and WebKit-based browsers (I checked in Safari, Chrome and iPhone).

在Firefox中,边框和文本的颜色相同(#880000 ),但是在Safari中,文本的颜色略浅(好像已应用了一些透明度).

In Firefox both border and text have the same color (#880000), but in Safari the text gets a bit lighter (as if it had some transparency applied to it).

我能以某种方式解决此问题(在Safari中消除这种透明度)吗?

Can I somehow fix this (remove this transparency in Safari)?

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <style type="text/css">
        input:disabled{
            border:solid 1px #880000;
            background-color:#ffffff;
            color:#880000;
        }
        </style>
    </head>
    <body>
        <form action="">
            <input type="text" value="disabled input box" disabled="disabled"/>
        </form>
    </body>
</html>

推荐答案

-webkit-text-fill-color: #880000;
opacity: 1; /* required on iOS */

这篇关于在iOS上禁用输入文字颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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