Why changing visibility/display on focus does not work?

前端 未结 4 1023
独厮守ぢ
独厮守ぢ 2020-12-11 05:01

I\'ve gotten an idea to make a search \"button\" upon clicking which the input box would show up and stretch. However instead of using an invisible checkbox I decided to try

4条回答
  •  粉色の甜心
    2020-12-11 05:15

    Elements that are not visible cannot receive focus, therefore the :focus psuedo-class cannot apply.

    Using width and opacity seems to produce a reasonable effect.

提交回复
热议问题