iPhone not properly showing image area on site. Why?

So, on 3 of my Android phones (different brands, etc.), one of my web pages looks like this (how it’s supposed to):

On my partner’s iPhone, a family member’s iPhone, and a friend’s iPhone, it looks like this:

My mobile SCSS file that renders the top image area is:

body.landing-page {
  &.blog {
    > .contents {
      max-width: 100%;
      width: 100%;
      display: block;
      padding: 1em;

      .page-first {
        display: none;
      }
    }
    .mobile-header .menu {
      background-color: #4a4a4a !important;
/*       height: min-content; */
    }
    
    .topic-list {
      grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
      padding: 2em 0 0 0;

      .topic-byline {
        .bull {
          padding: .2em .5em;
        }
      }
    }
  }

  .canvas {
    padding: 0.8em !important;
}

  .bull {
    display:none
    }

  &.blog-post {
    header {
      background-color: $secondary;
    }

    .container {
      width: 100%;
    }

    .post-container {
      width: 100%;
    }
    
    .title-container {
      background: no-repeat center/cover fixed;
      display: flex;
      flex-direction: column;
      min-height: 530px;
      max-height: 40%;
      justify-content: flex-end;
      align-items: center;

      .title {
        font-size: 2.0em !important;
        width: 100%;
        text-align: center;
/*         margin: 0 0 1em 0; */
      }

      .topic-byline {
        flex-direction: column;

        .bull {
          padding: .2em 1em;
        }
      }
    }

    img {
      max-width: 100%;
      height: auto;
    }
    
    .comment-container {
      .comment-heading h4 {
        text-align: center;
      }

      .comment-footer {
        padding: 0 2em;
        box-sizing: border-box;
        justify-content: center;
      }
    }
  }

  &.blog,
  &.blog-post {
    .btn-subscribe {
      padding: 0;

      .fixed-avatar {
        width: 60px;
        height: 60px;
      }
    }
  }
}

So, why does it seem on every iPhone, the image isn’t being properly positioned, but it is on multiple Android phones? How do I fix this? Been stuck on it for a good 30hrs total now. :upside_down_face: Weird thing is, also, on my Inspect Element, it’s showing fine there as well on a couple iPhone presets it has…but not their actual devices…

The landing pages plugin hasn’t been maintained for almost 2 years. I’d be wary of using it.

Not sure what’s going on there, but you’ve got some syntax errors in your code.

What ya mean that it hasn’t been maintained? I recently had @cabidop update some stuff on all 3 components of it that were merged to the main branches…unless ya meant something else :open_mouth:

GitHub - paviliondev/discourse-landing-pages: Adds landing pages to Discourse
GitHub - paviliondev/blog-landing-pages
GitHub - paviliondev/blog-landing-theme

Syntax errors, huh? Hmmm

Hello :wave:

I didn’t test it but it looks like to me it is caused the background-attachment: fixed;

The code you shared above there is:

.title-container {
  background: no-repeat center/cover fixed;
}

Which means:

.title-container {
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  background-attachment: fixed; // this cause the issue
}

Is the background-attachment: fixed; necessary in this case?

I mean I think it probably makes a kind of parallax effect. But this is not the best solution for that…as this is not too supported and maybe not necessary for your use case.

1 Like

Oh wow, that’s a really cool website you linked, thanks. I will try this as soon as my new VPS boots up and (hopefully) fully restored my site!

So, you’re saying to just delete the fixed part?

So I would have:

.title-container {
  background: no-repeat center/cover;
}

?