How to change border color of textarea on :focus

后端 未结 5 2219
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-07 17:25

Forgive me is this is a stupid question, but i need help. I want to change border color of TEXTAREA on focus. but my code doesn\'t seem to working properly.

Kindly v

相关标签:
5条回答
  • 2020-12-07 17:50
    .input:focus {
        outline: none !important;
        border:1px solid red;
        box-shadow: 0 0 10px #719ECE;
    }
    
    0 讨论(0)
  • 2020-12-07 17:54

    so simple :

     outline-color : blue !important;
    

    the whole CSS for my react-boostrap button is:

    .custom-btn {
        font-size:1.9em;
        background: #2f5bff;
        border: 2px solid #78e4ff;
        border-radius: 3px;
        padding: 50px 70px;
        outline-color : blue !important;
        text-transform: uppercase;
        user-select: auto;
        -moz-box-shadow: inset 0 0 4px rgba(0,0,0,0.2);
        -webkit-box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.2);
        -webkit-border-radius: 3px;
        -moz-border-radius: 3px;
    }
    
    0 讨论(0)
  • 2020-12-07 17:56

    There is an input:focus as there is a textarea:focus

    input:focus { 
        outline: none !important;
        border-color: #719ECE;
        box-shadow: 0 0 10px #719ECE;
    }
    textarea:focus { 
        outline: none !important;
        border-color: #719ECE;
        box-shadow: 0 0 10px #719ECE;
    }
    
    0 讨论(0)
  • 2020-12-07 17:58

    Probably a more appropriate way of changing outline color is using the outline-color CSS rule.

    textarea {
      outline-color: #719ECE;
    }
    

    or for input

    input {
      outline-color: #719ECE;
    }
    

    box-shadow isn't quite the same thing and it may look different than the outline, especially if you apply custom styling to your element.

    0 讨论(0)
  • 2020-12-07 18:02

    you need just in scss varible

    $input-btn-focus-width:       .05rem !default;
    
    0 讨论(0)
提交回复
热议问题