x

How do I change the background color for mobile phones?

How do I change the background color for mobile phones? I changed the html background color by editing the code. It worked for computer browsers. But it did not change the color on the phone. The blog does not provide an easy option to change the color. So I have to find where it is in the code. Any help is appreciated!

5,783 Views
Message 1 of 10
Report
9 REPLIES 9
Square

You'll probably need to do some extra CSS rules to change that, or modify the existing mobile CSS. What's the address of your site, and what color did you want to change the background to?

5,781 Views
Message 11 of 10
Report

Hi Adam,

Url: https://boatmakingworkshop.weebly.com/blog

Color: black

I guess I just don't know what code to look for... 

5,757 Views
Message 11 of 10
Report
Square

Add this to Settings > SEO > Header Code and it should change it to black on mobile:

<style>
	@media (max-width: 767px) {
		#main-content
		{
			background: #000 !important;
		}
	}
</style>
5,737 Views
Message 11 of 10
Report

Adding that style block to the SEO Header Code does not work to change the background on the mobile site I'm helping a friend on. I'm a UI designer and know CSS very well and can't believe that Weebly has made such a simple thing so incredibly difficult that after 2 hours I still can't find a way to do it. I've been customizing Squarespace sites for a couple of years and I can tell you that they are a LOT more flexible and easier to manage.

5,578 Views
Message 11 of 10
Report
Square

What site did you try it with, @paranoidandroid? I'm assuming that it has different class/ID names.

5,571 Views
Message 11 of 10
Report

I having the same issue as others. I thought I was good with HTML and CSS until I was put on this task. I've been working with sites for years, but am completely stumped. Can someone help me with what I need to change?

I need the mobile version to have a black background to match the web version. 

www.TheRueMorgueTattooGallery.com

5,407 Views
Message 11 of 10
Report
Square

Adding this to Settings > SEO > Header Code should fix that on the live site, @abaldwin:

<style>
	body
	{
		background: black !important;
	}
</style>
5,399 Views
Message 11 of 10
Report

Thank you for all your help! That worked! It is amazing how something so small can make you feel like you know nothing about something you've been working on for years. 

Tags (1)
5,393 Views
Message 11 of 10
Report
Square

Not a problem! And I wouldn't feel bad about it; this just means it's something we should be building an option for.

5,390 Views
Message 11 of 10
Report