I think you’re looking for animation-fill-mode
CSS3 property
https://developer.mozilla.org/en/CSS/animation-fill-mode
The animation-fill-mode CSS property specifies how a CSS animation should apply styles to its target before and after it is executing.
for your purpose just try to set
h2 {
animation: fadeIn 1s ease-in-out 3s;
animation-fill-mode: forwards;
}
Setting forwards value «the target will retain the computed values set by the last keyframe encountered during execution»