AsiaKeli01 Posted November 13, 2021 Share Posted November 13, 2021 Site URL: https://www.asiakeli.com/ I wanted to add a different logo image on hover to my site, so I followed a tutorial that had me upload a blank logo "mask" as the main logo file. The image hover effect is then achieved through the following custom CSS: .logo { background-image: url('https://static1.squarespace.com/static/60de8691b9b79d6982300717/t/6119da7ca80a3404d7c64b16/1629084285594/2021-periwinkle-logo.png'); background-size: contain; background-repeat: no-repeat; } .logo:hover { background-image: url('https://static1.squarespace.com/static/60de8691b9b79d6982300717/t/6119dacc085c8b02d5c9c0a5/1629084364565/2021-pink-logo.png'); } It works great on desktop, however I noticed it forces the logo to be left-aligned in mobile. I would like the logo to stay centered on mobile and desktop. The layout style is still set to "center" in my style settings. Is there any way to fix this while keeping the image hover effect? Any help would be appreciated! Link to comment
Solution Beyondspace Posted November 14, 2021 Solution Share Posted November 14, 2021 (edited) On 11/13/2021 at 11:43 AM, AsiaKeli01 said: Site URL: https://www.asiakeli.com/ I wanted to add a different logo image on hover to my site, so I followed a tutorial that had me upload a blank logo "mask" as the main logo file. The image hover effect is then achieved through the following custom CSS: .logo { background-image: url('https://static1.squarespace.com/static/60de8691b9b79d6982300717/t/6119da7ca80a3404d7c64b16/1629084285594/2021-periwinkle-logo.png'); background-size: contain; background-repeat: no-repeat; } .logo:hover { background-image: url('https://static1.squarespace.com/static/60de8691b9b79d6982300717/t/6119dacc085c8b02d5c9c0a5/1629084364565/2021-pink-logo.png'); } It works great on desktop, however I noticed it forces the logo to be left-aligned in mobile. I would like the logo to stay centered on mobile and desktop. The layout style is still set to "center" in my style settings. Is there any way to fix this while keeping the image hover effect? Any help would be appreciated! Hi @AsiaKeli01, You can try adding to Home > Design > Custom Css @media only screen and (max-width: 767px) { #logo .logo { background-position: center; } } Let me know how it works on your site Press 👍 or mark this answer as solution to help another one too Edited November 14, 2021 by bangank36 tuanphan and AsiaKeli01 1 1 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox) 🗓️ Delivery Date Picker (Squarespace Date format) 💫 Animated Buttons (Referral URL) 🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations) 🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
AsiaKeli01 Posted November 15, 2021 Author Share Posted November 15, 2021 17 hours ago, bangank36 said: Hi @AsiaKeli01, You can try adding to Home > Design > Custom Css @media only screen and (max-width: 767px) { #logo .logo { background-position: center; } } Let me know how it works on your site Press 👍 or mark this answer as solution to help another one too Worked like a charm! Thank you so much! Beyondspace 1 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