CSS从高度自动过渡到高度75%

Pee*_*n87 6 css height transition

我做了一个css过渡,从高度自动到高度:75%.

CSS-过渡:

-webkit-transition: height 0.5s ease-in-out;
-moz-transition: height 0.5s ease-in-out;
-o-transition: height 0.5s ease-in-out;
transition: height 0.5s ease-in-out;
Run Code Online (Sandbox Code Playgroud)

但它不适用于IE和Firefox.我在谷歌上发现了一些帖子,但无法找到解决方案.

谢谢你的帮助.

Dan*_*niP 3

要使用%andauto你可以尝试min-height像这样:

div {
  -webkit-transition: height 1s ease-in-out;
  -moz-transition: all 1s ease-in-out;
  -o-transition: all 1s ease-in-out;
  transition: all 1s ease-in-out;
}
div:hover {
  min-height:75%;
} 
Run Code Online (Sandbox Code Playgroud)

检查这个演示小提琴

在 Chrome 31 - Firefox 26 中测试