Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Cannot make input:focus overwrite default setting

I am trying to make a CSS style for a form using a border-bottom style that goes to a green box. However I see that the input:focus syntax does not work, and it shows the default focus style. Can anyone tell me how to overwrite the default focus style? Thank you.

<style>
.input1{
    border:0px;
    border-bottom:1px solid #999999;
}
.input1:focus{
    border:1px solid green;
}
</style>

<form action="">
<div>
  <input class="input1" type="text" id="texto" >
</div>
</form>

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Actually it works, you are missing outline: none;

<style>
.input1{
    border:0px;
    border-bottom:1px solid #999999;
}
.input1:focus{
    border:1px solid green;
    outline: none;
}
</style>

<form action="">
<div>
  <input class="input1" type="text" id="texto" >
</div>
</form>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading