GrahamG Posted July 1, 2023 Share Posted July 1, 2023 With an image in the background, I need the logo on my homepage to be white, I had added some custom code to achieve this but it no longer works. Not sure what happened, perhaps an update from Squarespace. This is the code I currently have: <script> window.onload = function() { document.querySelectorAll('.header-title-logo img')[0].src = 'https://static1.squarespace.com/static/5fd925449f6d8f67d97815cb/t/6043b664c343a45fe3d1e965/1615050340420/Graham-Green-white-cropped-150.png'; }; </script> Hoping someone can point me in the right direction to resolve this issue. Link to comment
tuanphan Posted July 3, 2023 Share Posted July 3, 2023 Actually you can replace that code with this to change to new logo. The code will apply for both desktop + mobile <style> header#header img { content: url(https://static1.squarespace.com/static/5fd925449f6d8f67d97815cb/t/6043b664c343a45fe3d1e965/1615050340420/Graham-Green-white-cropped-150.png); } </style> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
GrahamG Posted July 3, 2023 Author Share Posted July 3, 2023 4 hours ago, tuanphan said: Actually you can replace that code with this to change to new logo. The code will apply for both desktop + mobile <style> header#header img { content: url(https://static1.squarespace.com/static/5fd925449f6d8f67d97815cb/t/6043b664c343a45fe3d1e965/1615050340420/Graham-Green-white-cropped-150.png); } </style> This works great, unfortunately, I have a mobile-specific logo so it breaks mobile. I could have sworn that was not the case with the original code, but looking at it now, I could be wrong. Link to comment
Solution tuanphan Posted July 4, 2023 Solution Share Posted July 4, 2023 20 hours ago, GrahamG said: This works great, unfortunately, I have a mobile-specific logo so it breaks mobile. I could have sworn that was not the case with the original code, but looking at it now, I could be wrong. If target desktop only, use this code <style> .header-display-desktop img { content: url(https://static1.squarespace.com/static/5fd925449f6d8f67d97815cb/t/6043b664c343a45fe3d1e965/1615050340420/Graham-Green-white-cropped-150.png); } </style> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
GrahamG Posted July 5, 2023 Author Share Posted July 5, 2023 On 7/4/2023 at 4:52 AM, tuanphan said: If target desktop only, use this code <style> .header-display-desktop img { content: url(https://static1.squarespace.com/static/5fd925449f6d8f67d97815cb/t/6043b664c343a45fe3d1e965/1615050340420/Graham-Green-white-cropped-150.png); } </style> Perfect! Thank you so much! 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