Skip to content

Instantly share code, notes, and snippets.

@pawelgur
Created December 28, 2015 14:23
Show Gist options
  • Save pawelgur/a2cc60d7b9e9c3cbbcb1 to your computer and use it in GitHub Desktop.
Save pawelgur/a2cc60d7b9e9c3cbbcb1 to your computer and use it in GitHub Desktop.
Element fade in and out with pure css
/*
This will show/hide element with fade transition. Hidden element won't overlap any other.
*/
.fade-in-out {
height: 0;
opacity: 0;
transition: opacity 300ms, height 10ms 300ms; /* delay height transition until opacity is done */
&.hover{
height: 100%;
opacity: 1;
transition: opacity 300ms;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment