#fadeout{ opacity: 0; transition: opacity 2s linear; } #fadein{ opacity: 1; transition: opacity 2s linear; }