Googled this, but most topics are about parallax effects which involve, like, full widths and / or heights - e.g. for headers. What I want is this. If you take a look at the "We are good at" section, on the left column, there's a parallax effect. I looked at their code, but there's no chance I'm understanding what they've done there, so I thought that it should work by simply using flexbox.
Now, I managed to do the parallax effect using flexbox and background-attachment: fixed;
, but the image looks weird; it gets zoomed in and doesn't center properly. Here's how it looks like:
Here's how it should look like:
Here's the part of the code for that:
HTML:
<section class="section-skills">
<div class="item pri"></div>
CSS:
.section-skills{
display:flex;
padding-top: 40px
}
.item{
flex-basis: 0;
flex-grow: 1;
display: flex;
flex-direction: column;
}
.pri{
background-image: url(img/skills-007.jpg);
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
height: 567px;
width: 100%;
}
Here's a CodePen: http://codepen.io/anon/pen/VPVmLb
Is there something I'm missing? Or I shouldn't be using flexbox for parallax?