从textarea中删除所有样式(边框,发光)

hol*_*ard 58 css forms textarea border

我想从textarea中删除样式,如果可能的话,将其全部留白,没有任何边框或发光.我试过在这里发现不同的东西,但没有任何作用(试用FF和Chrome).

那么,它是否可能,如果是这样的话怎么做?

在此输入图像描述

到目前为止我尝试过的:

textarea#story {
  // other stuff
  -moz-appearance:none;
  outline:0px none transparent;
}

textarea:focus, input:focus{
    outline: 0;
}

*:focus {
    outline: 0;
}
Run Code Online (Sandbox Code Playgroud)

小智 110

发光效果最有可能由盒阴影控制.除了添加Pavel所说的内容之外,您还可以为不同的浏览器引擎添加box-shadow属性.

textarea {
    border: none;
    overflow: auto;
    outline: none;

    -webkit-box-shadow: none;
    -moz-box-shadow: none;
    box-shadow: none;

    resize: none; /*remove the resize handle on the bottom right*/
}
Run Code Online (Sandbox Code Playgroud)

您也可以尝试添加!important以确定此CSS的优先级.

  • 您还可以使用`resize:none;`删除右下角的调整大小手柄 (19认同)

Luc*_*s B 24

如果你想删除一切:

textarea {
    border: none;
    background-color: transparent;
    resize: none;
    outline: none;
}
Run Code Online (Sandbox Code Playgroud)