如何讓我的圖像在桌面和移動設備的頁面加載時淡入?目前我的代碼僅適用於移動設備。如何在頁面加載時淡入圖像
CSS:
#test img {
width: auto;
height: 50px;
position: absolute;
-webkit-animation: fadein 7s;
-moz-animation: fadein 7s;
-ms-animation: fadein 7s;
-o-animation: fadein 7s;
animation: fadein 7s;
}
@media only screen and (max-width: 768px) {
#test img {
width: auto;
height: 20px;
position: absolute;
}
}
的可能的複製[使用CSS的淡入在頁面加載效果(https://stackoverflow.com/questions/11679567/using -css-for-fade-in-effect-on-load) – JSnewbie