W3C home > Mailing lists > Public > www-style@w3.org > November 2012

Re: animate/transition height to/from auto

From: Alan Gresley <alan@css-class.com>
Date: Thu, 22 Nov 2012 23:36:00 +1100
Message-ID: <50AE1C30.6070409@css-class.com>
To: Michał Gołębiowski <m.goleb@gmail.com>
CC: Behrang Saeedzadeh <behrangsa@gmail.com>, W3C CSS Mailing List <www-style@w3.org>
Michał. Can you please reply below my comment.

On 22/11/2012 10:29 PM, Michał Gołębiowski wrote:
> min-height won't work good enough because transitioning min-height
> transitions min-height, not height. If the 'auto' element height is 100px
> and you set min-height to 1000px, the visible part of transition
> (min-height from 0 to 100px) will be very short.

I do not see the problem.

<!DOCTYPE html>

<style type="text/css" media="screen">

div { background: skyblue; padding: 1em;  }

div:hover {
    -webkit-transition: all 2s linear;
     -moz-transition: all 2s linear;
     -o-transition: all 2s linear;
     -ms-transition: all 2s linear;
     transition: all 2s linear;
     min-height: 1000px;
}

</style>

<div><div style="height:100px">Content</div></div>

Can you show a demo where a min-height solution does not work?

> Anyway, why changing 'auto' to 0 and back can't trigger a transition? This
> is changing the computed value...

I don't quite understand what you are saying here.

Alan



-- 
Alan Gresley
http://css-3d.org/
http://css-class.com/
Received on Thursday, 22 November 2012 12:36:29 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:02 GMT