views:

59

answers:

1

I'm working on a layout that switches a div between two classes, one with a height of 0px. CSS3 animations scale the div height great. The only problem is that I want it to scale to the content height, instead of a set height. Is this possible with CSS3 transitions?

Thanks all!

A: 

Have you tried to use:

height: auto;

This will change the height based on the content of the container, however if there is nothing in the container then the height will be 0. This is important if you are wanting to use the container with only a background image in it.

hexid