Css转换不起作用

时间:2018-04-07 13:26:12

标签: html css

我无法过渡到那个div,我不知道为什么, 我多次尝试没有成功

.desc-mov {
  background-color: #eee;
  font-size: 11px;
  color: black;
  height: 130px;
  width: 100%;
  opacity: 0.6;
  line-height: 1.5;
  transition: 5s;

  position: absolute;
}

.desc-mov:hover {
  bottom: 0px;
}
    <div class="desc-mov ">
    <p > how are you are that working</p>               

               </div>

1 个答案:

答案 0 :(得分:0)

您需要为绝对位置设置默认值才能使其正常工作。 试试这个:

.desc-mov {
  background-color: #eee;
  font-size: 11px;
  color: black;
  height: 130px;
  width: 100%;
  opacity: 0.6;
  line-height: 1.5;
  transition: 5s;
  top: 0;
  position: absolute;
}

.desc-mov:hover {
  top: 100%;
}
 <div class="desc-mov ">
    <p > how are you are that working</p>               
</div>