CSS transitions enable smooth changes of CSS property values from one state to another over a specified duration.
When the DIV element receives the .ng-hide class, the transition will last 0.5 seconds, smoothly reducing its height from 100px to 0.
<style> div { transition: all linear 0.5s; background-color: lightblue; height: 100px; } .ng-hide { |
CSS animations allow for smooth transitions of CSS property values from one value to another over a specified duration.
When the DIV element receives the .ng-hide class, the myChange animation will execute, smoothly transitioning the height from 100px to 0.
<style> @keyframes myChange { from { height: 100px; } to { height: 0; } } div { div.ng-hide { |