【问题标题】:Absolute image animate behing another div - Angular 5 animation另一个 div 后面的绝对图像动画 - Angular 5 动画
【发布时间】:2018-10-04 03:51:17
【问题描述】:

我有一张想要制作动画的图像,它应该从底部向上滑动到它的位置。我正在使用 Angular 5 动画,到目前为止我的动画效果很好,但并不完全符合我的要求。请检查此Plunker,因为它是我所拥有的示例。

好的,我有两个divheight: 50%。顶部的div 有一个图像(在plunker 中表示为红色方块)设置为position: absolute。 我正在为这张图片(红色方块)设置动画,使其从下到上出现,但问题是:

我希望图像来自底部,但要位于底部 div 并且它位于它的前面。

我尝试了z-index,但没有成功,找出原因,想不出另一种听起来不像便宜又丑陋的解决方法。

谢谢。

【问题讨论】:

    标签: css angular animation angular5 angular-animations


    【解决方案1】:

    position: relative; 与 z-index 一起添加到 #bottom div。

    #bottom {
      background: #a3c6ff;
      position: relative;
      z-index:1;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-02-04
      • 1970-01-01
      • 2013-10-02
      • 1970-01-01
      • 2014-08-15
      • 2011-06-30
      • 1970-01-01
      相关资源
      最近更新 更多