这是显示我的问题的图像 >> https://imgur.com/a/YpvMAYq << 这是我的 html 代码:
.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>
谢谢您阅读此篇 ;)
最佳答案
正如我在评论中提到的,当输入处于某种状态时,它看起来像是在设置背景。看起来您使用的是框架,如果没有在那里使用的代码或 codepen/jsfiddle,则无法分辨。css
下面将设置 background
至 transparent
当输入在 focus
或 active
状态。
.form-control:focus, .form-control:active {
background: transparent;
}
退房 this question有关输入状态的信息。
关于html - 输入框框,去掉 "background"颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51157869/