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

Copied code didn't work on the last background example. #8

Open
josecobi opened this issue Jul 16, 2024 · 1 comment
Open

Copied code didn't work on the last background example. #8

josecobi opened this issue Jul 16, 2024 · 1 comment

Comments

@josecobi
Copy link

josecobi commented Jul 16, 2024

I love your backgrounds. Great job! However, I could not get the last background to work on my website till I placed it inside another div and added z-index. It was showing on top of my header.

Original code copied from the website:

<div class="relative h-full w-full bg-slate-950"><div class="absolute bottom-0 left-0 right-0 top-0 bg-[linear-gradient(to_right,#4f4f4f2e_1px,transparent_1px),linear-gradient(to_bottom,#4f4f4f2e_1px,transparent_1px)] bg-[size:14px_24px] [mask-image:radial-gradient(ellipse_60%_50%_at_50%_0%,#000_70%,transparent_100%)]">
</div>
</div>

Working code I copied from the preview using dev tools:

<div class="fixed left-0 top-0 -z-10 h-full w-full">
			<div class="relative h-full w-full bg-slate-950">
				<div class="absolute bottom-0 left-0 right-0 top-0 bg-[linear-gradient(to_right,#4f4f4f2e_1px,transparent_1px),linear-gradient(to_bottom,#4f4f4f2e_1px,transparent_1px)] bg-[size:14px_24px] [mask-image:radial-gradient(ellipse_60%_50%_at_50%_0%,#000_70%,transparent_100%)]">
					
				</div>
			</div>
		</div>

I tried another one and didn't need any adjustments. but I didn't check all of them.

@yuvrajzingh
Copy link

Same with this one as well

`<div class="relative h-full w-full bg-white"><div class="absolute h-full w-full bg-[radial-gradient(#e5e7eb_1px,transparent_1px)] [background-size:16px_16px] [mask-image:radial-gradient(ellipse_50%_50%_at_50%_50%,#000_70%,transparent_100%)]"></div></div>`

It is working when I am using it inside another div

`<div className="fixed left-0 top-0 -z-10 h-full w-full">
	<div className="relative h-full w-full bg-white">
               <div className="absolute h-full w-full bg-[radial-gradient(#e5e7eb_1px,transparent_1px)] [background-size:16px_16px] [mask-image:radial-gradient(ellipse_50%_50%_at_50%_50%,#000_70%,transparent_100%)]"></div>
        </div>
</div>`

Great Backgrounds BTW, Thank you!!

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