DEV Community

Cover image for Background-attachment: Fixed:
Myles D
Myles D

Posted on

Background-attachment: Fixed:

I'm learning how to add a background image using css. I've got the image loaded but I want the image to stay put while I scroll.. Stack overflow and google said used Background-attachment:Fixed; but that isn't working for me. Any suggestions would be nice as well. Thanks

Top comments (4)

Collapse
 
ardianperlaska profile image
Ardian Perlaska

Can you maybe share bits of your code, so it'd be easier to help you out?

I created a Fiddle for you, which maybe can help you out:
jsfiddle.net/ardianperlaska/x0mwf4...

Collapse
 
luhlikelemonae profile image
Myles D • Edited

This is what I did

Collapse
 
ardianperlaska profile image
Ardian Perlaska

What Browser are you using? And what version?
Also, is the Fiddle working well for you?

Thread Thread
 
luhlikelemonae profile image
Myles D

I'm using chrome. Fiddle works well! I saw what you did and applied it to my code. It worked but not to the extent I was looking for. Super new to this coding life so I'm not exactly sure how I can show you what it looks like