内容在5秒后平滑消失 💥
HTML代码:
<div id="myText">
<div style="font-size:80px; font-weight: bold;">瓜皮之牙</div>
</div>	

CSS代码(消失后无法选中元素属性,比如超链接等)
@keyframes hideText {
    0% {
        opacity: 1;
        pointer-events: auto;
    }
    100% {
        opacity: 0;
        pointer-events: none;
    }
}

#myText { animation: hideText 1s linear 5s forwards; }


如果想消失后依然可以点击到元素属性,CSS代码如下(一般不会用到这个)
@keyframes hideText {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}

#myText { animation: hideText 1s linear 5s forwards; }