Here's my JS FIDDLE.
I would like that my div id="text"
be fixed. But it doesn't work with my code... The problem is that I need to keep all my content in my div id="wrapper"
. How can I do? If you have another solution for have the parallax effect on my image (only with css), let me know.
body {
overflow-x: hidden;
margin:0;
}
#text {
font-size: 70px;
height: 100%;
width: 100%;
position: fixed;
}
#intro {
font-size: 30px;
width: 100%;
border:3px solid yellow;
position: absolute;
}
#wrapper {
transform-style: preserve-3d;
height: 100%;
perspective: 1px;
overflow-x: hidden;
border:3px solid cyan;
position: fixed;
top: 0;
left: 0;
width: 100%;
}
#wrapper section {
position: relative;
height: 200px;
width: 300px;
background:pink;
box-sizing: border-box;
border:3px solid red;
transform-style: inherit;
overflow: hidden;
margin: 100px;
}
#wrapper section .back {
width: 300px;
border:3px solid green;
transition: transform 1s ease-out;
height:200px;
background-position: center center;
transform: translateZ(-0.6px) scale(1.5); }
.back {
background-image: url(http://wallpaper-gallery.net/images/background-image/background-image-18.jpg); }
#wrapper section .back:hover {
opacity: 0.5;
transform:translateZ(-0.4px) scale(2.6); }