上一个元素的过渡

时间:2019-03-20 13:40:33

标签: css sass

编辑

我的问题在这里出现:Is there a "previous sibling" CSS selector?

感谢:Temani Afif


当输入被聚焦时,我想在前面的元素上播放动画。我想为此使用过渡,但似乎无法上班。

HTML:

compute_rhino3d

SASS:

<div class="custom-form-group">
     <label for="input" class="custom-form-control-label">Label</label>
     <input id="input" class="custom-form-control" name="input" value="" required>
</div>

您可以在代码中看到,我想在label.custom-form-control-label { transform: translateY(15px) translateZ(200px) translateX(0); transition: ease-out 1s; } input.custom-form-control { //...style &:focus { //...more styling & ~ label.custom-form-control-label { transform: translateY(0px) translateZ(200px) translateX(0); } } } 被聚焦时在label上进行过渡。我真的很想在不使用Javascript的情况下做到这一点,并且make仅是SCSS。

0 个答案:

没有答案
相关问题