下面的简单 HTML 在 Firefox 和基于 WebKit 的浏览器中显示不同(我在 Safari、Chrome 和 iPhone 中检查过)。
在 Firefox 中,边框和文本具有相同的颜色 (#880000
),但在 Safari 中,文本会变得更亮一些(好像应用了一些透明度)。
我能以某种方式解决这个问题(在 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 */
关于iphone - 在 iOS 上禁用输入文本颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/262158/