0

I've got a problem with my inputs on google chrome, even tho i added the css codes that i found on the others threads related to this issue, it still persists on mouse focus.

I had no trouble getting rid of it when the input is not focused, but as soon as i click it, it turns yellow. I tried several combinations but it won't go away so far.

Here is some exemples of what i tried :

input:focus:-webkit-autofill {
    -webkit-box-shadow: 0 1px 1px 1000px #f7f7f7 inset, 0 0 2px rgba(109,157,78,.6);
    -webkit-text-fill-color: #333;
}

input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 1px 1px 1000px #f7f7f7 inset, 0 0 2px rgba(109,157,78,.6);
    -webkit-text-fill-color: #333;
}

I also tried with the input's id instead of input

Here is my full css file (in case it is needed

body {
    margin: 0;
    pasdding: 0;
    position: static;
}

body.ftp li#current-ftp, 
body.projects li#current-projects, 
body.contact li#current-contact {
    font-weight: bold;
    text-shadow: 0 0 1px #aaa;
}

#navbar-header {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    margin: 0;
    padding: 0;
}

#navbar-header #menu-left {
    float: left;
    display: inline-block;
    margin-left: 20px;
    font-family: 'Comfortaa', cursive;
    font-size: 16px;
    line-height: 1;
    color: #3F3F3F;
}

#navbar-header #menu-right {
    float: right;
    display: inline-block;
    margin-right: 20px;
    font-family: 'Comfortaa', cursive;
    font-size: 16px;
    line-height: 1;
    color: #3F3F3F;
}

#navbar-header ul {
    display: inline-block;
    list-style-type: none;
    margin: 5px 0 0 0;
    padding: 0;
    vertical-align: top;
    font-size: 16px;
    line-height: 1;
}

#navbar-header ul.icon li {
    display: inline-block;
    padding: 2px;
    margin: 0;
    vertical-align: top;
}

#navbar-header ul.txt li {
    font-family: 'Comfortaa', cursive;
    font-size: 16px;
    color: #3F3F3F;
    display: inline-block;
    margin: 0;
    padding: 8px 0 0 0;
}

#navbar-header ul.txt li a {
    font-family: 'Comfortaa', cursive;
    font-size: 16px;
    color: #3F3F3F;
    text-decoration: none;
    margin: 0;
    padding: 8px;
}

#navbar-header ul.txt a:hover {
    text-shadow: 0 0 1px #666;
}

#navbar-header #login-menu, #navbar-header #panel-menu {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
    padding: 0;
}

#navbar-header #login-bubble {
    font-family: 'Open Sans', sans-serif;
    z-index: 5;
    visibility: hidden;
    color: #AAAAAA;
    position: absolute;
    right: 10px;
    top: 50px;
    width: 250px;
    height: 130px;
    padding: 0 15px 0 15px;
    background: #FFF;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    border: #CCC solid 1px;
    -moz-box-shadow:0 0 8px 0 #DDD;
    -webkit-box-shadow:0 0 8px 0 #DDD;
    box-shadow:0 0 8px 0 #DDD;
}

#navbar-header #login-bubble:after {
    content: '';
    position: absolute;
    border-style: solid;
    border-width: 0 10px 10px;
    border-color: #FFF transparent;
    display: block;
    width: 0;
    z-index: 1;
    top: -10px;
    left: 214px;
}

#navbar-header #login-bubble:before {
    content: '';
    position: absolute;
    border-style: solid;
    border-width: 0 11px 11px;
    border-color: #DDD transparent;
    display: block;
    width: 0;
    z-index: 0;
    top: -12px;
    left: 213px;
}

#login-username, #login-password {
    margin-bottom: 15px;
}
#navbar-header .username-icon {
    position: absolute;
    display: block;
    color: darken(#EDEDED, 10%);
    left: 23px;
    top: 15px;
    font-size: 20px;
    line-height: normal;
}

#navbar-header .password-icon {
    position: absolute;
    display: block;
    color: darken(#EDEDED, 10%);
    left: 25px;
    top: 62px;
    font-size: 20px;
    line-height: normal;
}

#navbar-header input#txt_username, #navbar-header input#txt_password {
    font-family: inherit;
    box-sizing:border-box;
    border-radius: 3px;
    font-size: 14px;
    height: 30px;
    line-height: 30px;
    width: 100%;
    margin: 15px 0 0 0;
    padding: 0 8px 0 30px ;
    display: block;
    background-color : #f7f7f7; 
    border: 1px solid #CCC;
    transition: 0.3s ease-out;
    -webkit-transition: 0.3s ease-out;
    -moz-transition: 0.3s ease-out;
    color: #333;
}

#navbar-header input#txt_username:focus, #navbar-header input#txt_password:focus {
    padding: 0 8px 0 10px ;
    background-color : #f7f7f7; 
    border-color: #a6ba89;
    outline: 0px;
    -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 2px rgba(109,157,78,.6);
    -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 2px rgba(109,157,78,.6);
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 2px rgba(109,157,78,.6)
}

input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px #fcfcfc inset;
    -webkit-text-fill-color: #333;
}

.placeholder {color: #aaa }
::-webkit-input-placeholder {color: #aaa}
:-moz-placeholder {color: #aaa}

#navbar-header #forgotten-pwd {
    font-size: 13px;
    font-family: inherit;
    margin-top: 12px;
    display: inline-block;
}

#navbar-header #forgotten-pwd a {
    text-decoration: none;
    color: #999;
}

#navbar-header #forgotten-pwd a:hover {
    color: #f48a00;
}

#button-border {
    width: 61px;
    height: 30px;
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
    border: 1px solid #CCC;
    border-top: 0;
    position: absolute;
    right: 26px;
    bottom: -30px;
    -moz-box-shadow:0 0 8px 0 #DDD;
    -webkit-box-shadow:0 0 8px 0 #DDD;
    box-shadow:0 0 8px 0 #DDD;
}

#submit-button {
    font-family: inherit;
    z-index: 1000;
    position: absolute;
    top: 105px;
    right: 34px;
}
#sub-login {
    font-family: inherit;
    width: 45px;
    height: 45px;
    display: block;
    margin: 0 auto -15px auto;
    background: #f7f7f7;
    border-radius: 100%;
    border: 1px solid #a6ba89;
    color: #a6ba89;
    font-size: 26px;
    line-height: 26px;
    cursor: pointer;
    box-shadow: 0px 0px 0px 7px #FFF;
    transition: 0.3s ease-out;
}
#sub-login:hover, #sub-login:focus {
    background: #a6ba89;
    color: #f7f7f7;
    outline: 0;
}

#navbar-header #panel-bubble {
    z-index: 5;
    visibility: hidden;
    color: #AAAAAA;
    position: absolute;
    right: 0;
    top: 0;
    margin-top : 50px;
    margin-right: 10px;
    width: 220px;
    height: 250px;
    padding: 0px;
    background: #FFF;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    border: #CCC solid 1px;
    -moz-box-shadow:0 0 8px 0 #CCC;
    -webkit-box-shadow:0 0 8px 0 #DDD;
    box-shadow:0 0 8px 0 #DDD;
}

#navbar-header #panel-bubble:after {
    content: '';
    position: absolute;
    border-style: solid;
    border-width: 0 10px 10px;
    border-color: #FFF transparent;
    display: block;
    width: 0;
    z-index: 1;
    top: -10px;
    left: 145px;
}

#navbar-header #panel-bubble:before {
    content: '';
    position: absolute;
    border-style: solid;
    border-width: 0 11px 11px;
    border-color: #DDD transparent;
    display: block;
    width: 0;
    z-index: 0;
    top: -12px;
    left: 144px;
}

#panel-more {
    border-top: 1px solid #EEE;
    position: absolute;
    bottom: 0px;
    right: 0px;
    left: 0px;
    height: 30px;
    witdth: 100%;
    background-color: #F7F7F7;
    font: 16px Candara;
    text-align: center;
    vertical-align: middle;
    color: #909090;
    padding-top: 3px;
}

#header-logo {
    position: relative;
    width: 333px;
    margin: 30px auto 15px auto;
}

my inputs's id are #txt_password and #txt_username

And here is the form :

<div id="login-menu">
        <div id="login-bubble">
            <form method="post" action="/ftp/index.php?login=1">
                <span id="login-username">
                    <input type="text" name="username" id="txt_username" placeholder="username" required="" value="" />
                    <span class="username-icon"><i class="fa fa-user"></i></span>
                </span>
                <span id="login-password">
                    <input type="password" name="password" id="txt_password" placeholder="password" required="" />
                    <span class="password-icon"><i class="fa fa-lock"></i></span>
                </span>
                <span id="forgotten-pwd">
                    <a href=""><span>Forgotten Password ?</span></a>
                </span>
                <span id="submit-button">
                    <input type="hidden" name="redirect" value="<?php echo "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; ?>" />
                    <button type="submit" name="submit" id="sub-login"><i id="submit"class="fa fa-long-arrow-right"></i></button>
                </span>
                <span id="button-border"></span>
            </form>
        </div>
    </div>

Does somebody have an idea about where might the conflict come from ?

Thanks a lot for the help.

-Apatik

apatik
  • 383
  • 4
  • 17
  • 1. Could you show your issue on JSFiddle or something similar? 2. Do you have to use autocomplete feature? 3. Did you try this selector (input:-webkit-autofill)? – max Oct 26 '15 at 23:29
  • Thanks for your answer, i tried adding a JSFiddle box but i coudln't reproduce the issue since it only appears on chrome and it needs username/password stored. Yes i might disable autocomplete if i can't find the solution to resolve this, and yeah i tried (input:-webkit-autofill) and it actually does work, but (input:-webkit-autofill:focus) doesn't :( – apatik Oct 26 '15 at 23:40

1 Answers1

0

you probably sorted this out already, but anybody who comes across the same question can find the solution here:

Removing input background colour for Chrome autocomplete?

Very close to the code you originally posted, but not quite the same! :)

Community
  • 1
  • 1
Dan
  • 530
  • 6
  • 22