Reputation: 128
I have to provide a background color (#eeeeee) to a readonly input field.
.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
cursor: not-allowed;
background-color: #eeeeee;
opacity: 1;
}
<input id="tagNumber" name="j_username" class="form-control" tabindex="1" data-enhance="false" data-role="none" value="" maxlength="241" autocomplete="off" readonly="" type="text">
This works fine in all the browsers except the safari browser. In safari the background color remains white. I have tried providing the background color via jquery and also by adding a specific class to the element at run time. Nothing seems to work. Plz help.
How it looks on non safari browsers:
How it looks on safari browsers:
Upvotes: 2
Views: 4762
Reputation: 5869
try this it may works
# @media screen and (-webkit-min-device-pixel-ratio:0)
{
#safari { background-color:#eeeeee }
}
or try rgb in your background colour for eg:
rgb(238, 238, 238) for #eeeeee
background-color:rgb(238, 238, 238);
Upvotes: 1