katieburk Posted August 27, 2020 Share Posted August 27, 2020 (edited) Site URL: https://chrysalis-collie-n4gg.squarespace.com/ Note the password to view my test site: ;WKy%,:PC3#8bjX: The main page of my website (https://chrysalis-collie-n4gg.squarespace.com/work) has photos that you can click on to go to other pages (different categories of work). Each of these photos has a title shown over the lower part of it. I would like that text to be highlighted (i.e. the box behind the text should have a color and obscure that part of the photo it covers). Right now the text is black and sits in front of the photo. User tuanphan helped with a similar background color question last week. Unfortunately I have not had success adapting that solution for my new problem. When I "view source" my page, I see that this text is written as a h2 with class Blog-title. For example: <h2 class="Blog-title" data-content-field="title">The NPR Calendar</h2> So I tried to use the "code injection" option to set the background color of h2s in the Blog-title class to be my specified color. Unfortunately, this code does not appear to do anything: <style> h2.Blog-title {background: #F7E5EE !important;} </style> I know the h2 specification is correct because if I specify e.g. color instead of background, it changes the font color correctly, and if I specify font-size it changes the font size. So I am definitely targeting the right part of the page, it is something about my use of background above which is called. I have also tried e.g. background-color, and not using !important. I am not sure what else it could be called or how to find out. Does someone know what I am doing wrong here? Edited August 27, 2020 by katieburk Link to comment
Solution Beyondspace Posted August 27, 2020 Solution Share Posted August 27, 2020 You may want to use padding on the element like so Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio pluginIf you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you Link to comment
katieburk Posted August 27, 2020 Author Share Posted August 27, 2020 1 hour ago, bangank36 said: You may want to use padding on the element like so Thank you!! This works. I did not consider that setting padding could be necessary here. 🙂 Beyondspace 1 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