Sunday 29 January 2017

CSS Transition from height auto to height 75%





I made a css transition which is from height auto to height: 75%.



CSS-Transition:



-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;



But its not working in IE and Firefox. I found some posts on google, but couldnt find a solution.



Thanks four your help.


Answer



To work with % and auto you can try with min-height like this:



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%;
}


Check this Demo Fiddle



Tested in Chrome 31 -- Firefox 26



No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...