Using :focus to style outer div?

后端 未结 10 752
礼貌的吻别
礼貌的吻别 2020-12-02 18:24

When I begin writing text in the textarea, I want the outer div, with a class box, to have it\'s border turned solid instead of dashed, but somehow the :focus doesn\'t apply

10条回答
  •  被撕碎了的回忆
    2020-12-02 18:55

    Some people, like me, will benefit from using the :focus-within pseudo-class.

    Using it will apply the css you want to a div, for instance.

    You can read more here https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-within

提交回复
热议问题