【问题标题】:Change border color of <input> when selected选择时更改 <input> 的边框颜色
【发布时间】:2022-01-28 09:49:16
【问题描述】:

我正在为 next.js 应用程序编写登录屏幕,当我选择一个时,边框的颜色变成了这种白色+蓝色的混合。

我尝试了以下方法

.input:focus {
  border: 5px solid #f23;
}

但它改变了其他东西:

如何更改边框的颜色?

<input type="text" className={styles.input} style={{ marginBottom: 10 }} autoComplete="off" autoCorrect="off" autoCapitalize="off" aria-required="true" spellCheck="false" placeholder="Email" ></input>

【问题讨论】:

    标签: html css next.js


    【解决方案1】:

    您正在查看的可能是一个大纲: https://www.w3schools.com/css/css_outline.asp

    要么创建您的 outline: none; 并使用 border 属性,要么只是重新设置大纲的样式:

    .input:focus {
      outline: 5px solid #f23;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-06-26
      • 2017-03-06
      • 2023-03-06
      • 1970-01-01
      • 2012-06-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多