1
我已經創建了一個關鍵幀的例子來放大和縮小背景圖像。這是工作,但也縮放內部文本。如何啓用放大背景圖像?
我只需要將背景圖像放大。因此,圖像彼此不同,用戶將有機會放大背景圖像。
@-webkit-keyframes snow {
0% { background-position: 0px 0px, 0px 0px, 0px 0px }
50% { }
100% {
background-position: 500px 1000px, 400px 400px, 300px 300px;
;
}
}
@-moz-keyframes snow {
0% { background-position: 0px 0px, 0px 0px, 0px 0px }
50% { }
100% {
background-position: 500px 1000px, 400px 400px, 300px 300px;
}
}
@-ms-keyframes snow {
0% { background-position: 0px 0px, 0px 0px, 0px 0px }
50% { }
100% {
background-position: 500px 1000px, 400px 400px, 300px 300px;
;
}
}
@keyframes snow {
0% { background-position: 0px 0px; }
50% { }
100% {
background-position: 5px 1000px;
}
}
div{
width:100%;
height:100vh;
background-image:
url('http://wallpaperlatest.com/wp-content/uploads/3d-live-wallpaper-free-download-1.jpg');
background-size:100% 100%;
position:fixed;
top:0;left:0;
width:100%;
height:100vh;
animation: zoom 30s infinite;
text-align:center;
}
h1{
color:#fff;
font-size:50px;
}
@keyframes zoom {
0% { transform:scale(1,1); }
50% { transform:scale(1.2,1.2); }
100% {
transform:scale(1,1);
}
}
<div>
<h1>OVER TEXT</h1>
<a href="http://wallpaperlatest.com/free-live-wallpapers-download/">Image Souce:</a>
</div>
喔.. !!我現在明白了.. :)非常感謝... @Ryan – Yodha
總是樂於幫忙! :) – Ryan