我申请课程

时间:2016-04-29 10:03:00

标签: css3 css-transitions

当一个类应用于div时,我想从右向左滑动div。我尝试了下面的代码。但它没有用。有什么不对吗?

.dealer-info {
    left:100%;
    -webkit-transition-property: left; /* Safari */
    -webkit-transition-duration: 2s; /* Safari */
    transition-property: left;
    transition-duration: 2s;
}

.dealer-info.dealer-show {
    left:0%;
}

1 个答案:

答案 0 :(得分:0)

请根据您的要求将位置添加为relativeabsolutefixed

.dealer-info {

left:100%;
position: relative; /* or absolute depending on your use case */

  -webkit-transition-property: left; /* Safari */
-webkit-transition-duration: 100s; /* Safari */
transition-property: left;
transition-duration: 2s;
}

.dealer-info.dealer出现{

left:0%;
}