移除 HTML 中的 textarea 边框

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1042257/
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:01:01  来源:igfitidea点击:

Removing the textarea border in HTML

htmlcsstextareaborder

提问by PROFESSOR

I'm working with the textareaelement in HTML and want to remove the border of the box. I also want to align the text in the bottom of my textarea.

我正在处理textareaHTML 中的元素并希望删除框的边框。我还想在我的textarea.

回答by John Kugelman

Add this to your <head>:

将此添加到您的<head>

<style type="text/css">
    textarea { border: none; }
</style>

Or do it directly on the textarea:

或者直接在textarea上做:

<textarea style="border: none"></textarea>

回答by Jacob

In CSS:

在 CSS 中:

  textarea { 
    border-style: none; 
    border-color: Transparent; 
    overflow: auto;        
  }

回答by SilverHorn

This one is great:

这个很棒:

<style type="text/css">
textarea.test
{  
width: 100%;
height: 100%;
border-color: Transparent;     
}
</style>
<textarea class="test"></textarea>

回答by SilverHorn

textarea {
border: 0;
overflow: auto; }

less CSS ^ you can't align the text to the bottom unfortunately.

少 CSS ^ 不幸的是,您无法将文本与底部对齐。