我有一个输入文本字段,当用户聚焦在它上面时,我希望 box-shadow 属性从一种样式过渡到另一种样式。但是我两个 CSS 声明中有什么问题导致过渡无法发生呢?
input[type="text"], textarea { box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.3) inset; transition: box-shadow 0.33s ease-in-out; }
input[type="text"]:focus, textarea:focus { box-shadow: 0 0 7px 0 rgba(30, 144, 255, 1); }