katieburk Posted August 27, 2020 Share Posted August 27, 2020 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? Link to comment
Beyondspace Posted August 27, 2020 Share Posted August 27, 2020 You may want to use padding on the element like so BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations) 🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates) 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
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. 🙂 Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.