input-box
带有可以设置为 0
的轮廓。
然后它将在其周围显示一个丑陋的边框。
这个边框也可以设置为none
,让输入框没有边框。
但是我只想在输入框的顶部和底部放置一个边框,但无法完成。 有什么想法吗?
最佳答案
将此应用于您的输入元素
input {
border: 1px solid #000; /* this will give the input 1px black border all around */
border-left: 0 none;
border-right: 0 none;
}
应该这样做。
或者,你也可以去
input {
border: 0; /* resets default border */
border-top: [your border styling];
border-bottom: [your border styling];
}
关于html - 如何设置输入框的每边边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32710982/