【问题标题】:Removing the textarea border in HTML删除 HTML 中的 textarea 边框
【发布时间】:2010-11-05 17:58:39
【问题描述】:

我正在使用 HTML 中的 textarea 元素,并希望删除框的边框。我还想对齐textarea底部的文本。

【问题讨论】:

    标签: html css textarea border


    【解决方案1】:
    textarea {
        border: none;
        outline: none;
    }
    

    【讨论】:

    • 这不会删除 IE 中的滚动按钮。我的解决方案应该涵盖这一点。
    【解决方案2】:

    在 CSS 中:

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

    【讨论】:

    • @Jacob 是否可以在 <textarea> 标签本身内直接包含如何执行此操作?
    • @user5783745:你可以把它放在style属性中:<textarea style="border-tyle: none; border-color: Transparent; overflow: auto"></textarea>
    【解决方案3】:

    这个很棒:

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

    【讨论】:

      【解决方案4】:
      textarea {
      border: 0;
      overflow: auto; }
      

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

      【讨论】:

        【解决方案5】:

        另外,您可以删除调整大小图标

        textarea {resize:none;}
        

        【讨论】:

          猜你喜欢
          • 2013-06-11
          • 2016-06-04
          • 1970-01-01
          • 2013-01-07
          • 1970-01-01
          • 1970-01-01
          • 2016-01-31
          • 2015-03-13
          • 1970-01-01
          相关资源
          最近更新 更多