What will cause the error "(CSS 3.0):": -webkit-autofill "is not a valid pseudo-class."

I have an MVC web application that I create using Visual Studio 2015.

Some of my forms use autocomplete for input elements, but when using Chrome, automatically filled fields are left with an unpleasant pale yellow background due to the style sheet of the user agent Chrome. A widespread solution to this is to use the following CSS to render inputs without a yellow background:

input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px white inset !important;
}

This approach works great in all of my previous projects (which were built using Visual Studio 2013).

However, in my CSS file, the above code appears as invalid with the following error:

Validation (CSS 3.0): ": -webkit-autofill" is not a valid pseudo-class.

My previous projects use CSS3 and they recognize the pseudo-class and apply the style as expected. I searched for Q & A here and searched for this error, but I did not find anything that could solve this problem.

Please can someone shed light on a) What could be causing this error, and b) Any possible solutions.

To clarify further, I apply the style at the very bottom of my Site.css file, and there are no inline styles that could overcome the expected behavior. Developer tools confirm that the style is not applied, which indicates that the error is indeed what stops the style from being applied.

VS2013 , , VS2015, , .

.

+4
1

:-webkit-autofill css, Visual Studio 2015 - , .css.

, , : Tools > Options > Text Editor > CSS > Advanced, "" . , - , .

, !

+2

Source: https://habr.com/ru/post/1657742/


All Articles