skip to Main Content

I’m trying to build a subscribe form on wordpress theme. The inputs only have border-bottom, which I have styled in css. However, when I try to repeat the same operation for input:focus, the border remains unchanged. How do I resolve this problem?

footer input:focus {
  border: none;
  border-bottom: 0.1vmin solid honeydew;
}

2

Answers


  1. When everything else fails you can always play it dirty with

    !important
    
    footer input{
    border-bottom:2px solid red!important;
    }
    footer input{
    border-bottom:2px solid #000;
    }
    footer input.test{
    border-bottom:2px solid blue;
    }
    <footer>
    <input class="test" type="text">
    </footer> 

    Tags marked by important overrule pretty much everything else.

    Login or Signup to reply.
  2. First, when you are checking in the devtools, make sure you actually have the input focused, otherwise the :focus style rules won’t show in the devtools list. Then scroll down the list and check if your css rule is anywhere in the list (it may be lower down if it is overriden). If it isn’t, check that you are using the correct css selector. If the selector is definitely correct, you probably aren’t loading the styles correctly.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search