禁用输入文本颜色 [英] Disabled input text color

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

问题描述

下面的简单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 ),位轻(如果它有一些透明度应用于它)。

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)?

strong>

谢谢您的答案。我不需要这个我的工作了(而不是禁用我替换输入元素样式 div 元素),但我仍然好奇为什么会发生这种情况,如果有任何方法来控制这种行为...

UPDATE:
Thank you for your answers. I don't need this for my work anymore (instead of disabling I'm replacing input elements with styled div elements), but I'm still curious why this happens and if there is any way to control this behavior ...

<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

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

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