Css 使用具有相对属性的transform3d向上滑动

Css 使用具有相对属性的transform3d向上滑动,css,Css,我试图用css属性transfrom在按钮点击时向上滑动一个元素:translate3d0,-100px,0;但是下面有相对位置的元素不会向上滑动,因为该元素会留下一些空间 第一个容器CSS属性: 第二个容器Css属性: 您能否提供引起问题的html标记,以便我们相应地调整答案?transform属性不会影响转换元素周围内容的流动。@jbutler483两个容器html如下所示:单击时关闭。sg\u btn父容器向上移动,但使调整容器保持原样。通过将第一个容器的相对位置更改为绝对位置,解决了问题

我试图用css属性transfrom在按钮点击时向上滑动一个元素:translate3d0,-100px,0;但是下面有相对位置的元素不会向上滑动,因为该元素会留下一些空间

第一个容器CSS属性:

第二个容器Css属性:


您能否提供引起问题的html标记,以便我们相应地调整答案?transform属性不会影响转换元素周围内容的流动。@jbutler483两个容器html如下所示:单击时关闭。sg\u btn父容器向上移动,但使调整容器保持原样。通过将第一个容器的相对位置更改为绝对位置,解决了问题。
.setupContainer {
position: relative;
display: inline-block;
width: 100%;
height: 100px;
text-align: center;
background-color: rgba(23, 29, 97, 0.9);
color: #FFF;
cursor: default;
z-index: 1;
-webkit-transform: translate3d(0,-100px,0);
-moz-transform: translate3d(0,-100px,0);
-ms-transform: translate3d(0,-100px,0);
-o-transform: translate3d(0,-100px,0);
transform: translate3d(0,-100px,0);
-webkit-transition: all 300ms ease-in-out;
-moz-transition: all 300ms ease-in-out;
-ms-transition: all 300ms ease-in-out;
-o-transition: all 300ms ease-in-out;
transition: all 300ms ease-in-out;
}
.top_header {
position: relative;
width: 98%;
height: 165px;
background: #FFF;
margin: 0 auto;
float: none;
clear: both;
top: 1%;
text-align: center;
margin-bottom: 3px;
border-bottom: 2px solid #8CC5A7;
}