Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Input field box, remove "background" color

Tags:

html

css

This is the image which shows my problem >> https://i.sstatic.net/MLJSa.jpg << Here's my html code:

.form-control {
    width: 600px;
    fill: none;
    background: transparent;
    border: none;
    border-bottom: 1px solid grey;
    font-size: 18px;
    margin-bottom: 16px;
}
<form id="contactForm" method="POST" action="">
  <input name="fName" type="text" class="form-control" placeholder="What should I call you? Person X?" required>
  <br>
  <input name="email" type="email" class="form-control" placeholder="Only, if you want to be emailed back">
  <br>
</form>

Thank you for reading this ;)

like image 510
Adrian Avatar asked Oct 23 '25 09:10

Adrian


1 Answers

As I mentioned in a comment, it looks like a background is being set when the input is in a certain state. It looks like your using a framework and it is impossible to tell without the code used there, or a codepen/jsfiddle.

The css below will set the background to transparent when the input is in focus or active states.

.form-control:focus, .form-control:active {
    background: transparent;
}

Check out this question for information on input states.

like image 196
Anthony Avatar answered Oct 26 '25 01:10

Anthony



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!