Jump to content

CSS code injection conflict

Recommended Posts

Site URL: https://www.sharemyhome.co.uk

Hi, 

A couple of years back I put together a site which, for context, uses a bit of custom CSS for typefaces and some other minor styling points, along with code injection in the header and footer for Google Tag Manager. There have been some minor changes in terms of image removal and a bit of repositioning by the owner but nothing on a code/CSS level, since then.

A few days ago the owner of the site contacted me to say the on the home page the type styles have been over-ridden to render in black (instead of a grey colour used on the other pages/the site styles and themes) the burger menu icon disappears from the mobile view, the social media icons are rendering in white/transparent in the footer, and all the container/background colours for sections have disappeared.

SS themselves have said to the owner that when the site is previewed with scripts disabled it reverts back to normal, which is true. I've removed the scripts and saved the site without them as another test but that doesn't make the site render in it's normal colours etc. Besides, the tag manager script is required, which is an issue in and of itself, if removed.

Does anyone have any ideas on what conflict could be causing the overrides and disappearing icons etc when the scripts are active? I've attached a couple of images to help demonstrate the issue.

no scripts preview.png

live site.png

Edited by BenJG
typo
Link to comment
  • Replies 7
  • Views 473
  • Created
  • Last Reply

Top Posters In This Topic

Add to Design > Custom CSS

/* Fix errors */
footer.sections .section-background {
    background-color: #f9f7f7 !important;
}
[data-section-id="5ef2552214ce7c31c39f4c3b"] .section-background {
    background-color: #386a93 !important;
}
[data-section-id="5ef2552214ce7c31c39f4c3b"] * {
    color: white;
}

 

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

Hi @tuanphan 

Thanks for that CSS, it's worked perfectly for that section, though the issues with the icons in the footer rendering in white, the mobile navigation icon also rendering in white are still present, some of the background colours are still missing too.

Would it be a case of finding the tags for each of these and using the same CSS above with the tag replaced to suit?

I've attached more screenshots to demonstrate. Anything showing with the correct colours, is due to having scripts disabled. Appreciate your help.

1446042552_Screenshot2022-09-12at09_45_16.thumb.png.8315c660e6e212103134ae3d603f441d.png864082828_Screenshot2022-09-12at09_45_48.thumb.png.4552b889f16be214d0a1a3180f8ae026.png1581696864_Screenshot2022-09-12at09_43_47.thumb.png.304b1555f0f79760b6b1ebf79771acd8.png684366081_Screenshot2022-09-12at09_43_54.thumb.png.f98fa9be00b2d563ac352b0ff4606359.png96985390_Screenshot2022-09-12at09_44_05.thumb.png.4a85c7830a8aef77da822d358285f401.png1581696864_Screenshot2022-09-12at09_43_47.thumb.png.304b1555f0f79760b6b1ebf79771acd8.png

Screenshot 2022-09-12 at 09.40.27.png

Screenshot 2022-09-12 at 09.45.55.png

Link to comment
On 9/12/2022 at 3:48 PM, BenJG said:

Hi @tuanphan 

Thanks for that CSS, it's worked perfectly for that section, though the issues with the icons in the footer rendering in white, the mobile navigation icon also rendering in white are still present, some of the background colours are still missing too.

Would it be a case of finding the tags for each of these and using the same CSS above with the tag replaced to suit?

I've attached more screenshots to demonstrate. Anything showing with the correct colours, is due to having scripts disabled. Appreciate your help.

1446042552_Screenshot2022-09-12at09_45_16.thumb.png.8315c660e6e212103134ae3d603f441d.png864082828_Screenshot2022-09-12at09_45_48.thumb.png.4552b889f16be214d0a1a3180f8ae026.png1581696864_Screenshot2022-09-12at09_43_47.thumb.png.304b1555f0f79760b6b1ebf79771acd8.png684366081_Screenshot2022-09-12at09_43_54.thumb.png.f98fa9be00b2d563ac352b0ff4606359.png96985390_Screenshot2022-09-12at09_44_05.thumb.png.4a85c7830a8aef77da822d358285f401.png1581696864_Screenshot2022-09-12at09_43_47.thumb.png.304b1555f0f79760b6b1ebf79771acd8.png

Screenshot 2022-09-12 at 09.40.27.png

Screenshot 2022-09-12 at 09.45.55.png

The problem comes from SS, it can happen in many sites, you should contact to see if they can fix it soon. If they still don't have a solution soon, I will give the code for the whole thing. But I guess will require a lot of code

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
  • 2 weeks later...

I have the exact same problem, i only added some custom code to change the colour of the logo in some pages. it worked fine until last week and still does on all pages apart from the home page. Like BenJG, footer rendering in white, header text black instead of white, mobile navigation gone. When i remove the code from the page everything is ok apart from the logo that i need it to be negative. Is there any simple way around this? I m not good with code

website is: unklesa.org

Link to comment
16 hours ago, unklesa said:

first photo shows problem, second is the code i have added, 3rd is when scripts are removed

Screen Shot 2022-09-30 at 5.45.24 PM.png

Screen Shot 2022-09-30 at 5.46.17 PM.png

Screen Shot 2022-09-30 at 5.47.04 PM.png

First, Line 7 need a closing </style> tag

Next, Line 1 is invalid code

Next, to make nav to white, use this code

<style>
  div.header-nav-item a {
    color: white !important;
}
</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

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.