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 on top of parallax #36

Open
andyscoming opened this issue Jul 3, 2023 · 1 comment
Open

Text on top of parallax #36

andyscoming opened this issue Jul 3, 2023 · 1 comment

Comments

@andyscoming
Copy link

How am I able to put my text on top of the parallax? I use a div with a background image but all my layered text disappears when the page loads.

@yitengjun
Copy link
Owner

There are several possible methods, but the important thing is to separate the parallax element from the content element.
When placing content, such as text, within the parallax element, the content elements are also affected by the parallax effect. Therefore, it is important to separate and position them in a way that avoids this influence.
Here is an example of placing text elements on top of a parallax image:

<div class="wrapper">
  <div class="background"></div>
  <div class="text">text</div>
</div>

https://codesandbox.io/s/text-on-top-of-parallax-elements-in-background-image-ukiyo-js-tkmwqv

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

2 participants