1
<div id='element-with-transition'>
    <div class='child'>
       <div style='display:none'>Something here...</div>
       <div style='display:none'>Something here...</div>
       <div style='display:none'>Something here...</div>
    </div>
</div>

<style>
#element-with-transition{
        -webkit-transition: height 3s;
        transition: height 3s;   
}
</style>

When I change display:none to display:block the content is shown but the transition is not fired. I already tried changing the transition from height to all, but nothing changes. Am I doing it correctly?

Ricardo Neves
  • 495
  • 3
  • 11
  • 24

1 Answers1

1

You can not change display:none; to display:block; with transition. If you want to animate height then your have to use height:0; overfloaw:hidden; for initial state then set height:100px; (or any desired value) for final state.

demonofthemist
  • 4,081
  • 4
  • 26
  • 45