Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text overflows at the bottom of parallax image #225

Open
kpagcha opened this issue Feb 4, 2021 · 2 comments
Open

Text overflows at the bottom of parallax image #225

kpagcha opened this issue Feb 4, 2021 · 2 comments

Comments

@kpagcha
Copy link

kpagcha commented Feb 4, 2021

I am trying to make a parallax block with a background image and some text, but when the text is at the bottom of the div, it "overflows" it and appears outside of the image when you scroll too far.

The same happens with a semi opaque overlay I'm using to darken the background. Here's a screenshot:

imagen

And here's my code:

<div class="wrapper">
    <img src="background.jpg" class="rellax-img" data-rellax-speed="2">
    <h1>Heading</h1>
</div>

CSS:

.wrapper {
    height: 100vh;
    overflow-y: hidden;
    width: 100%;
    position: relative;
}

.wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45));
}

.rellax-img {
    width: 100%;
    height: 100%;
}

JS:

const rellax = new Rellax('.rellax-img');

How can I have both elements inside the image while keeping the parallax effect?

@lear2000
Copy link

lear2000 commented Aug 5, 2021

me too.. anyone?

@kufnakrees
Copy link

Any updates on this? Can't figure this out either...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants