Jump to content

Code used has made website text disappear

Go to solution Solved by tuanphan,

Recommended Posts

Hi there! I have been having an ongoing issue with using trademarks (™) and registered trademarks (®) on my client's website. They are too big - almost the same height as the text (the ® specifically barely appears as a subscript. The best solution I found to date was code in the CSS section and the code injection section (please see the code I used below). Using this code has caused a few of my text blocks on my published site to disappear. Does anyone have any tips of decreasing the size of the trademarks using code while still showing all text across my website? Thank you in advance!

CSS:

.symbol {

    font-size: 1rem !important;

    vertical-align: super;

}

h1 .symbol {

  font-size: 1.5rem !important;

}

h2 .symbol {

  font-size: 1.3rem !important;

}


Code Injection:

<script>
document.addEventListener('DOMContentLoaded', (event) => {
    // Select both titles and descriptions
    const elements = document.querySelectorAll('.list-item-content__title, .list-item-content__description, .sqs-block-content');

    elements.forEach(element => {
        if (element.textContent.includes('®') || element.textContent.includes('™')) {
            // Replace ® with ® wrapped in a span for each element
            element.innerHTML = element.innerHTML.replace(/®/g, '<span class="symbol">®</span>');
        }
    });
});


</script>

Link to comment
On 5/2/2024 at 10:19 PM, amplicitycomm said:

https://duck-seal-hwdl.squarespace.com/custom-fence PW: squarespace

 

Under the header "Our Products" on this page, there should be a paragraph of text. I can see it in edit mode, but it disappears on the live site. This happens on many of the pages.

 

Thank you!

You can use this code to Website > Website Tools > Custom CSS to fix problem.

div.html-block p {
    opacity: 1 !important;
}

 

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
On 5/6/2024 at 9:18 PM, amplicitycomm said:

This worked!!!! Thank you! I seem to also be missing some headings as well, like on this page: https://duck-seal-hwdl.squarespace.com/custom-fence/fence-installation is there anything I can do to solve this? Thank you!

Which heading text?

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.