Nickss Posted January 6, 2022 Share Posted January 6, 2022 (edited) Site URL: https://www.psicodigitale.it/ Hello, I have a logo on my website that is white since the header background is of a dark colour (see image attached) but when I open the hamburger menu on mobile, the background becomes white and so my logo disappears (see second image attached). I would like to substitute the bright logo with a dark one when I open the header menu on mobile. Note that the logo on my website is already been substitute with a custom css to add an svg instead of the png. This is the code that I'm currently using. Thank you all in advance. .header-title-logo img { visibility: hidden; } .header-title-logo a { background-image: url(https://static1.squarespace.com/static/60b1ecaf18ba745a54d1484d/t/61d2f9b0476ad24119bfebb3/1641216454121/Logo-Psicodigigitale-Colore.svg); background-size: contain; background-repeat: no-repeat; background-position: center center; } Edited January 6, 2022 by Nickss Changed "header menu" with "hamburger menu" Link to comment
SquareRefresh Posted January 7, 2022 Share Posted January 7, 2022 Hey @Nickss try this .header--menu-open { .header-title-logo img { content: url("URL HERE") !important; max-height:inherit !important; } } SquareRefresh, premium plugins & templates that have an elevated feel. Plugins: Have your site stand out. Templates: Our templates are designed with versatility in mind.Get Freebies: Sometimes things in life are free. Browser our hand selected free plugins. Link to comment
Nickss Posted January 8, 2022 Author Share Posted January 8, 2022 Hey thank you so much for this. Simply pasting your code didn't do the trick but I managed to make it work by coping and pasting my previous code inside the /header--menu-open{}. So to make it work now the whole code looks like this: /*Make Squarespace Logo Invisible*/ .header-title-logo img { visibility: hidden; } /*Add my SVG logo*/ .header-title-logo a { background-image: url(https://static1.squarespace.com/static/60b1ecaf18ba745a54d1484d/t/61d2f9b0476ad24119bfebb3/1641216454121/Logo-Psicodigigitale-Colore.svg); background-size: contain; background-repeat: no-repeat; background-position: center center; } /*Add dark SVG logo on hamburger menu*/ .header--menu-open { .header-title-logo a { background-image: url(https://static1.squarespace.com/static/60b1ecaf18ba745a54d1484d/t/61d2fa62c928c16903613f46/1641216632340/Logo-Psicodigitale-Dark-colorato.svg); background-size: contain; background-repeat: no-repeat; background-position: center center; } } 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