SSchulze Posted November 4, 2021 Share Posted November 4, 2021 Site URL: https://www.infinix.com/landing Hello, I am trying to underline two words in a page title but can't seem to make it work. The page title for the page is "How to Make Secondary Caries Go Away!" I want to underline the "Go Away!" part only. https://www.infinix.com/landing Thank you, Stephanie Link to comment
Beyondspace Posted November 4, 2021 Share Posted November 4, 2021 (edited) 1 hour ago, SSchulze said: Site URL: https://www.infinix.com/landing Hello, I am trying to underline two words in a page title but can't seem to make it work. The page title for the page is "How to Make Secondary Caries Go Away!" I want to underline the "Go Away!" part only. https://www.infinix.com/landing Thank you, Stephanie You can add to Home > Settings > Advanced > Code Injection, choose the footer <script> (function(){ /*separate Go Away title*/ document.addEventListener('DOMContentLoaded',()=>{ const pageTitle = document.querySelector('#page-title'); const titleWords = pageTitle.textContent.split(' '); const strongWord = titleWords.slice(titleWords.length - 2).join(' '); const normWord = titleWords.slice(0, titleWords.length - 2).join(' '); const htmlPageTitle = `<span class="normal-title">${normWord}</span> <span class="strong-title">${strongWord}</span>`; pageTitle.innerHTML=htmlPageTitle; }); })(); </script> <style> /*style for Go Away title*/ #page-title .strong-title { text-decoration: underline; } </style> Let me know how it works on your site Support me by pressing 👍 if this useful for you Edited November 4, 2021 by bangank36 SSchulze 1 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - Lightbox captions only mode) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace 🚀 Learn how to rank new pages on Google in 48 hours! 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
Beyondspace Posted November 4, 2021 Share Posted November 4, 2021 My testing result SSchulze 1 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - Lightbox captions only mode) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace 🚀 Learn how to rank new pages on Google in 48 hours! 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
SSchulze Posted November 4, 2021 Author Share Posted November 4, 2021 This worked great!!!! Beyondspace 1 Link to comment
Beyondspace Posted November 4, 2021 Share Posted November 4, 2021 You can delete this row or update my previous code It 's just the result when i tested in console. BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - Lightbox captions only mode) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace 🚀 Learn how to rank new pages on Google in 48 hours! 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment