Hello! I have gotten pretty far in my efforts to customize the London theme the way I want it, but I am having a problem I can’t solve. The way I did it: I set a background image for the body. To make text legible over it, I created three images that use transparency to fade into a paper texture, one for post-content-header, one for post-content-body, and one for gh-foot. For a desktop design, this is set up to create a 520px wide safe area for text; for mobile, the paper texture should cover the whole screen, left and right. I have had no end of trouble figuring out why the design uses negative margins and how to get the post-content-header, post-content-body, and gh-foot images to actually stretch to the end, but I came up with something that mostly works. Here is the mobile query:
@media screen and (max-width: 767px) {
body {
background-size: 100%;
}
.post-content-header {
background-image: url("/assets/images/cc-mobile-post-content-header-bg.png");
margin-left: -40px;
margin-right: -40px;
padding-left: 20px;
padding-right: 20px;
background-position-x: center;
background-position-y: bottom;
background-size: 850px 100%;
background-repeat: repeat-x no-repeat;
}
.post-content-body {
background-image: url("/assets/images/cc-mobile-post-content-body-bg.png");
margin-left: -40px;
margin-right: -40px;
padding-left: 20px;
padding-right: 20px;
background-size: 850px 320px;
background-position-x: center;
background-repeat: no-repeat round;
}
.gh-foot {
background-image: url("/assets/images/cc-mobile-gh-foot-bg.png");
background-size: 850px 100%;
max-height: 66px;
margin-left: -40px;
margin-right: -40px;
padding-left: 20px;
padding-right: 20px;
background-position-x: center;
background-position-y: top;
background-repeat: no-repeat;
}
}
This renders fine in any responsive-design test I throw at it, but it fails miserably if I rotate my phone . Here’s what it looks like in portrait mode–you can see the blueprints fading out with the whole horizontal stretch of the screen covered:
And here is what it looks like if I rotate the screen. Not only do the background image and transparent overlay fail to extend to the edges of the screen, there’s a small area where the transparent overlay does not extend as far as the background image.
Here is a closeup of the transparency not completely covering the background:
It seems to work okay and switch back and forth normally when I resize a browser window, and it works fine if I stay in portrait mode, but landscape mode is a disaster. I am so close to having this site working and being able to get to writing content instead of struggling with CSS and handlebars, but getting the backgrounds to work correctly is killing me. What am I missing? My site is unlocked for now, at https://thecriterioncontraption.com.
Thank you so much for your help with this!