这样定义一个2s渐隐消失的过渡效果:
div { opacity: 0; transition: opacity 2s; -moz-transition: opacity 2s; /* Firefox 4 */ -webkit-transition: opacity 2s; /* Safari 和 Chrome */ -o-transition: opacity 2s; /* Opera */ }