0

This is just an example. I wanted the border of input to be rounded when it is clicked. But it did not happen.

.username {
    border-radius: 0%;
}
.username :focus{
    border-radius: 30%;
}
<input class="username" type="text" placeholder="Username or Email">
Sato Takeru
  • 1,669
  • 4
  • 12
  • 27
  • Get rid of the space between username and focus. `.username:focus{}` the pseudo may be `:active` actually. – zero298 Jan 13 '21 at 04:42

3 Answers3

2

For me, getting rid of the space worked. Change: .username :focus {} to .username:focus {}

D-Waqas
  • 84
  • 9
1

Get rid of the space between username and focus. .username:focus{} the pseudo may be :active actually.

.username:active {
   color: red;
}
zero298
  • 25,467
  • 10
  • 75
  • 100
1

I think your answer is like this.

    .username {
        border: 2px inset;
        border-radius: 0px;
    }
    .username:focus {
        border-radius: 10px;
        outline: none;
    }
<input class="username" type="text" placeholder="Username or Email">
Sato Takeru
  • 1,669
  • 4
  • 12
  • 27