Tapaz Posted June 14, 2021 Share Posted June 14, 2021 Site URL: https://www.starbucks.co.uk/ Hi, I'd like to know how to add a static element to a page, I mean, an element that does not move when you scroll the page up or down. One example of that is the Starbucks website (you can see when you access it in a desktop). I've contacted squarespace support but they told me it would only be possible through a custom code. https://www.starbucks.co.uk Thanks! Link to comment
aravsanj Posted June 14, 2021 Share Posted June 14, 2021 What you want is a fixed element, not a static one. It is done by using position:fixed attribute. Here is an example: <div id="element"> </div> <style> #element { height:100px; width:100px; background:red; position:fixed; } </style> Try pasting the above code in a code block and the element will be fixed at the top-left corner even when you scroll. You can use top, left, right, and bottom properties to fix the permanent position of the element. tuanphan 1 Sharing virtual tactics for an abstract worldBlogger @ humaneer.org Link to comment
tuanphan Posted June 15, 2021 Share Posted June 15, 2021 If you want make an image static, you can add an image block on footer, then we will give the code to achieve this. or if you want text only, use @aravasanj code Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
Nathan-Elliott Posted June 8 Share Posted June 8 Bumping this concept back up! I'm interested in this as well. I'd love to have an image stay fixed as the rest of the content scrolls. Huge benefit here to be able to keep a common Call To Action in view at all times. https://www.eqlz.com/products/1100-panther Is there a way of doing this? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment