<style>
.fixed-bg {
background-image: url("img_tree.jpg"), url("img/person.png"), url("img/person3.png");
background-position: 10px 0px, 50px, 50px 50px;
background-repeat: no-repeat, no-repeat, no-repeat; /* no repite las iamgenes */
min-width: 100%;
min-height: 100%;/* espacio de altura */
background-attachment: fixed; /* hace el efecto de subir scroll */
}
@keyframes nube {
0%{background-position: 0 0;}
50%{background-position: -200 0;}
100%{background-position: -400 0;}
</style>
</head>
<body>
<p>In this example, we have created a fixed background image that will disappear slowly on scroll. Scroll the page to see the effect. <strong>Note:</strong> Try to remove the background-attachment property to really understand this example.</p>
<div class="fixed-bg"></div>
<div style="height:800px;background-color:yellow;">This div is only here to enable scrolling (height = 800 pixels).</div>
</body>
<style>
.fixed-bg {
background-image: url("img_tree.jpg"), url("img/person.png"), url("img/person3.png");
background-position: 10px 0px, 50px, 50px 50px;
background-repeat: no-repeat, no-repeat, no-repeat; /* no repite las iamgenes */
min-width: 100%;
min-height: 100%;/* espacio de altura */
background-attachment: fixed; /* hace el efecto de subir scroll */
animation: nube 2s linear infinite;
}
@keyframes nube {
0%{background-position: 0 0;}
50%{background-position: -200 0;}
100%{background-position: -400 0;}
</style>
background-image: url("img_tree.jpg"), url("img/person.png"), url("img/person3.png");
<html>
<head>
<style>
.fixed-bg {
background-image: url("img_tree.jpg"), url("img/person.png"), url("img/person3.png");
background-position: 10px 0px, 50px, 50px 50px;
background-repeat: no-repeat, no-repeat, no-repeat; /* no repite las iamgenes */
min-width: 100%;
min-height: 100%;/* espacio de altura */
background-attachment: fixed; /* hace el efecto de subir scroll */
animation: nube 2s linear infinite;
}
@keyframes nube {
0%{background-position: 0 0;}
50%{background-position: -200 0;}
100%{background-position: -400 0;}
</style>
</head>
<body>
<p>In this example, we have created a fixed background image that will disappear slowly on scroll. Scroll the page to see the effect. <strong>Note:</strong> Try to remove the background-attachment property to really understand this example.</p>
<div class="fixed-bg"></div>
<div style="height:800px;background-color:yellow;">This div is only here to enable scrolling (height = 800 pixels).</div>
</body>
</html>