我一直在尝试创建一个非常简单的登录页面。如您所见,这些输入周围有黑色边框。我的问题是,如何删除边框?
chrome://flags/#form-controls-refresh
大约83+版本的chrome更改了表单的呈现/处理方式。button {
border: none;
}
button:checked {
border: none;
}
否则,问题可能出在您使用的浏览器的功能上。我希望能提供帮助,并尽可能添加所使用的代码段。
outline: none;
添加到元素: #testInput {
outline: none;
border-radius: 10px;
border: 1px solid red;
height: 25px;
width: 225px;
padding: 5px 10px;
}
<input id="testInput" type="text" placeholder="If you click here, no border is shown!" />
您也可以尝试禁用此标志:chrome://flags/#form-controls-refresh
。这样会将轮廓的颜色更改为浅蓝色,这是Google更改选项之前的默认设置。但是,如果您尝试建立一个面向公众的网站,则第一种选择会更好,因为并非所有人都禁用了该标志。希望这会有所帮助!