I have login popup on a webpage. The login form contains two fields username and password. Both input fields have a background image (shown with help of CSS).
But during login, autofill of chrome browser populates data in the form fields and hides background image , image is shown on the extreme left of the input fields. So, its not like text is overriding image.
I read other answers suggesting moving image out of the input fields. I need image in input box only. What CSS or JS trick can be used here to show background image in input box even on autofill of Chrome browser?
Here is what I am trying:
HTML:
<input class="form-text-inputs"
type="text"
name="password"
ng-pattern="ctrl.usernameRegex"
placeholder="{{'USER.PASSWORD_PLACEHOLDER' | translate}}"
ng-model="ctrl.password"
maxlength="50"
required>
CSS:
input[type = 'password'] {
background-image: url(../assets/images/passwordimage.png) ;
padding-left: 36px;
}