Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabled input text color on iOS

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

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

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>
like image 847
Incidently Avatar asked Nov 04 '08 15:11

Incidently


People also ask

How do you change the font color for disabled input?

Approach: With adding basic CSS property we are able to change the font-color of a disabled input. The disabled input element is unusable and un-clickable. This is a boolean attribute. Here using the color property of input we can change the font-color of this disabled input element.

How do you make a text box disabled?

We can easily disable input box(textbox,textarea) using disable attribute to “disabled”. $('elementname'). attr('disabled','disabled'); To enable disabled element we need to remove “disabled” attribute from this element.


1 Answers

-webkit-text-fill-color: #880000; opacity: 1; /* required on iOS */ 
like image 114
Kemo Avatar answered Oct 16 '22 12:10

Kemo