Aayush Rohatgi
Aayush Rohatgi

Reputation: 128

Background color remains white for safari browser

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:

enter image description here

How it looks on safari browsers:

enter image description here

Upvotes: 2

Views: 4762

Answers (1)

Udhay Titus
Udhay Titus

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

Related Questions