Hi guys, has anyone built code to lock the position of an image or the background as you scroll up and down a page? Thanks!
Page 1 / 1
Hi Pierre - Fixing a image and/or background is certainly possible with a little CSS magic.
To fix an image:
Drop in the following script below into your CSS Stylesheets box:
#lp-pom-image-10 <br />
{ <br />
position:fixed; <br />
top:30px; <br />
right:5px; <br />
} <br /> </style>```
This script requires you to specify the fixed position of the image so update the 'top' and 'right' properties as needed.
You'll also want to replace #lp-pom-image-10 with the ID of your image. This can be found by selecting your image and scrolling down to "Advance" on the "Properties" tab.
[http://screencast.com/t/aSab4yI8I](http://screencast.com/t/aSab4yI8I)
**To fix a background:**
First you'll want to set the background image in the "Page Properties" Tab:
[http://screencast.com/t/ddlAVFkP8CT](http://screencast.com/t/ddlAVFkP8CT)
Then add this snipped of CSS into your CSS stylesheets box:
```<style> <br />
#lp-pom-root
<br /> { <br /> background-attachment:fixed; <br /> } <br /> </style>```
Reply
Log in to the Unbounce Community
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.