当孩子从父边框移出时,如何为子div使用像框架这样的父div?

时间:2019-06-26 05:21:17

标签: html css

我正在尝试动画使子div上下移动(上下移动)。但是,在这样做的同时,我想将父级用作边框,以便它越过父级边框就消失。我的意思是: enter image description here 这是我的屏幕 当孩子离开父母时,会发生这种情况 enter image description here 但是我想要的是 enter image description here 然后孩子消失了。我该怎么办?

1 个答案:

答案 0 :(得分:1)

将此添加到父div

overflow: hidden;