Tagged: background image, Colour section, mobile
-
AuthorPosts
-
June 12, 2016 at 9:52 pm #647032
Hi there
I have two colour sections on one page with an ID I have given to each of them. What I have done is change the background image url when the site is viewed on mobile, since the image background cannot be resized to look good on mobile.
However, the first colour section works, but there are some pages that have 2 colour sections on a page that need to change. The second one won’t change, and it just stays the same.
I have been trying for a while but can’t seem to sort it out.. Any help would be appreciated!
Thanks
June 12, 2016 at 10:12 pm #647049Hey ShaunNotcutt,
Would you mind providing a precise link to your site, showing the elements in question? We need to be able to inspect them in order to help :)
Best regards,
AndyJune 12, 2016 at 10:17 pm #647055Hi Andy
Sure, the link is http://help2read.org/the-literacy-crisis, I am looking at he top colour section id is #mobilepics
This one works well, and then image changes, the css I used is:@media only screen and (max-width: 480px) { #mobilepics { background-image: url("http://help2read.org/help2read/wp-content/uploads/2016/05/background5edited.jpg")!important;}
But the section further, section id is #bottompic doesn’t work on mobile, I use the same code really:
#bottompic { background-image: url("http://help2read.org/help2read/wp-content/uploads/2016/05/background4editedbigfile.jpg")!important;}
I did put both pieces of code inside the @media {} section in the CSS, didn’t work, then tried putting the bottom one inside it’s own @media {} but also didn’t work..
Thanks
June 13, 2016 at 12:23 pm #647303Hi Andy,
I seem to have worked it out, it seems like the sections with the background image set to fixed will not work, you have to have it set to scroll and then it will work.
Is there a way to make it work with the background set to fixed by any chance? If not, its not a major problem.
Thanks
June 16, 2016 at 3:08 am #648921 -
AuthorPosts
- You must be logged in to reply to this topic.