html - 如何在 Angular 中为 ng-otp-input 包的输入字段赋予边框颜色?

标签 html css angular typescript

我正在使用 ng-otp-input 包,我想在输入字段聚焦时将其边框颜色更改为红色。
套餐引用链接https://github.com/code-farmz/ng-otp-input
下面是我的代码
HTML

     <ng-otp-input (onInputChange)="pinModelChange('otp',$event)" [config]="otpConfig"
                ></ng-otp-input>

typescript

 otpConfig :NgOtpInputConfig = {
    allowNumbersOnly: true,
    length: 6,
    isPasswordInput: false,
    disableAutoFocus: false,
    placeholder: '',
    inputStyles:{
      'display':'flex'
    },
    containerStyles:{
      'display':'flex'
    },
    inputClass:'each_input',
    containerClass:'all_inputs'
  };

CSS

.each_input:focus{
  border: 2px solid red!important;
}

当输入字段处于聚焦状态时,我无法删除实心黑色边框

最佳答案

尝试

.each_input:focus {
    outline-style: solid;
    outline-color: red;
}

关于html - 如何在 Angular 中为 ng-otp-input 包的输入字段赋予边框颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74107318/

相关文章:

php - 无法显示 Font-Awesome 图标

html - 背景大小 : cover is not working to completely fill div with background-image

javascript - Internet Explorer 中的 HTML5 元素 : runtime insertion

angular - 将 ID 保存到 Firestore 文档

unit-testing - 对具有依赖关系的组件进行单元测试,有什么问题?

HTML5 音频播放器在移动设备上调整大小

javascript - 我无法在 javascript 中使用 '\n",我不知道为什么它不起作用

html - 如何阻止 html 网络下载相同的图像?

javascript - 元素变为宽度为 0

javascript - 在 Angular 7 中实现 redux 会出现错误 TS2307 : Cannot find module 'redux' . 错误