Html 只有底部边框的文本框

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21807454/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 00:56:27  来源:igfitidea点击:

Textfield with only bottom border

htmlcss

提问by Rust

How can I create a Text field that has a transparent or no background, no top,left and right border?

如何创建具有透明或无背景、无顶部、左侧和右侧边框的文本字段?

I am only using CSS and HTML.

我只使用 CSS 和 HTML。

回答by JunM

Probably a duplicate of this post: A customized input text box in html/html5

可能是这篇文章的副本:html/html5 中的自定义输入文本框

input {
  border: 0;
  outline: 0;
  background: transparent;
  border-bottom: 1px solid black;
}
<input></input>

回答by Douglas Denhartog

See this JSFiddle

看到这个JSFiddle

 input[type="text"]
    {
        border: 0;
        border-bottom: 1px solid red;
        outline: 0;
    }
<form>
        <input type="text" value="See! ONLY BOTTOM BORDER!" />
    </form>