HTML 去掉 textarea focus时的外边框

7 min read

可以使用 CSS 中的 outline 属性来去掉 textarea focus时的外边框,设置为 none 即可:

textarea:focus {
  outline: none;
}

示例代码:

<textarea rows="4"></textarea>
textarea:focus {
  outline: none;
}

效果如图所示:

去掉textarea的外边框