0

Yes, there's a lot of questions about this, but none of them seems to work with me.

I need to change the autocomplete background color on google chrome:

enter image description here

enter image description here

I already tried all of this:

Solution 1

Solution 2

Solution 3

This is my css:

input:-webkit-autofill { -webkit-box-shadow: 0 0 0px 1000px black inset; }

And this is my cshtml:

 <div class="row m-t-50">
       <div class="input-field col s12">
           <input id="last_name" type="text" class="validate" asp-for="Username">
           <label for="last_name">Usuário</label>
       </div>
    </div>

Any ideas?

Community
  • 1
  • 1
perozzo
  • 750
  • 2
  • 12
  • 28

1 Answers1

1

First of all, the code should be working and appropriate. In my mind, there could be two possible reasons of seeing not any changes in your css class:

1- One scenario that happened to me a number of times is when Chrome does not apply defined css styles to the page properly and the only solution I've found to this problem is to restart the computer.

2- If you are using a css library such as Bootstrap or MDL, ensure that they do not have predefined identical definition. I have never checked it out. However, by using the Chrome Developer Tools, you may figure it out:

enter image description here

enter image description here

Amir H. Bagheri
  • 1,283
  • 1
  • 8
  • 15
  • I'm using Bootstrap css library and yes, it have predefined identical definition. Just changed what I needed and it worked like a charm. Thank you very much! Save my day! – perozzo Apr 06 '17 at 10:47