Header Image Big in Mobile
- This topic has 4 replies, 2 voices, and was last updated 3 years ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.
My website http://www.planetearthlings.org looks good on mobile…EXCEPT…the header image is big to the point that it hangs out and creates a big background area going down each page. It is also possible to swipe left/right and it bounces around sideways instead of just scrolling up and down. Any suggestions on how I fix this? Thanks!
Hi Greg – Sorry for the late response. For your header image issue, the image is spilling over into the left background. I think that is why it is not minimizing correctly on mobile devices. I see this CSS:
div#icext-16f6e2e3 a, h1#icext-16f6e2e3 a {
top: 15px;
width: 512px;
height: 92px;
position: absolute;
left: 50%;
margin-left: -256px;
}
If you remove the negative margin-left, it looks a lot better on mobile
You could also use some conditional CSS that would apply just to the mobile state. Something like this:
@media only screen and (max-width: 600px) {
div#icext-16f6e2e3 a, h1#icext-16f6e2e3 a {
top: 15px;
width: 512px;
height: 92px;
position: absolute;
left: 50%;
margin-left: 0px;
}
}
And play around with the CSS attributes until it looks good. This would retain your original design for non-mobile displays.
CBOX does not provide swiping functionality, but I did see this article that might help you out. https://css-tricks.com/simple-swipe-with-vanilla-javascript/
There is also a plugin that lets you swipe through members – https://wordpress.org/plugins/bp-member-swipe/
Hey Scott…thanks for getting back to me. I’m not a web techie. Could you tell me which CSS file I should be looking for? I’ve checked the CSS both in the main CBox and I’m not seeing the lines you mentioned. Really appreciate your help. Cheers, Greg
Hi Greg – when you log in to your site, your should see the “Customize” option on the top toolbar. If you don’t see it there, go to Appearance>>Customize on your dashboard.
In Customize, the last option is “Custom CSS.” Here you can override the CSS settings on your site.
Try adding either of the snippets that I provided above.
In either snippet, make sure to set margin-left: 0px;