Jump to content

Different font colour on website and desktop

Recommended Posts

Posted

Hi, I'd be grateful for help from anyone who knows a solution to this:

I'd like to a have different colour for the title of my page(s) on desktop browser to the one on the mobile because the image underneath impacts readability. Is there code to do this?

You can see pictured, the title "Catalogue" in colour #424855 shows up well against a white background but not when the image behind is formatted for mobile. On mobile breakpoints, I'd prefer the font colour to #fffff. 

Can you help? 

 https://kangaroo-oriole-jxjt.squarespace.com/

Password: RichardPantcheffWebsite

Screenshot 2024-06-13 at 23.01.54.png

Screenshot 2024-06-13 at 23.01.14.png

  • Replies 16
  • Views 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Posted (edited)

@spantchux If it's only for the catalogue page, you can add this code under Website > Pages > Website Tools > Custom CSS. If you simply add the section ID of a page in the above code, the heading color will change to #ffffff.

@media screen and (max-width: 767px) {	
	section[data-section-id="65b3b7506b04b27d83371cfe"] {
		h1, h1 span {
			color: #ffffff !important;
		}
	}
}

 

If you want to change the text color of all headings in the first section of every page to #ffffff, add this code:

@media screen and (max-width: 767px) {	
	#sections:first-child h1, #sections:first-child h1 span {
		color: #fff !important;
	}
}

 

Edited by Lesum

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

Posted

I don't think that's the issue. I tried adding the closing bracket line 13...

Is there anyway you could take a look at the whole code?

Posted

@Lesum Sorry to bother you again... The code is working but it's also applied to a couple of other pages which I didn't want it to. 
I thought by adding the section code, it was specific to certain pages.

Posted
10 minutes ago, spantchux said:

Ahh I see. So how do I alter the code so I can make it page specific, not site wide for all h1 header?

Please refer to the first block of code in the solution I shared. For each page where you want to change the text color, add the page's section ID after a comma.

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

Posted

Apologies, I thought thats what I had done! I used the code pictured which is the one which uses section ids to denote where to apply the code.

Screenshot 2024-06-14 at 22.56.57.png

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.