1

I wrote a user login page, but I can not change inputted fields backgound color.

.form-signin-row {
    display: block;
    width: 100%;
    height: 51px;
    padding: 6px 12px;
    font-size: 14px;
    margin-bottom: 19px;
    line-height: 1.42857143;
    background-color: #F0EEF0;
    border: 1px solid #DCDCDC;
    border-radius: 4px;
    -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
    -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
    -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
    transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
}

Like this:

enter image description here

I found "user agent stylesheet":

input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill {
    background-color: rgb(250, 255, 189);
    background-image: none;
    color: rgb(0, 0, 0);
}

Just chrome cached my username and password, NOT work. If I clear cached, work well.

I try to override:

input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill { 
     background-color: #fff;
}

still not work:

enter image description here

2
  • not the same problem. @aug Commented Feb 24, 2016 at 10:15
  • Possible duplicate of this Commented Feb 24, 2016 at 10:19

1 Answer 1

3

Use the same class to override the default styles of the chrome browser (that behaviour is a big crap to designers)

input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill { 
     background-color: #fff !important;
     -webkit-box-shadow: 0 0 0px 1000px white inset;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.