Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Different background image on mobile - I tried one code already but the new image shows only for a moment


nela22

Question

Site URL: https://www.nelakubickova.com/

So I tried this code:


@media screen and (max-width:767px) {
[data-section-id="5fa2232697ec03254a90eb09"] .section-background img {
    visibility: hidden !important;
}
[data-section-id="5fa2232697ec03254a90eb09"] .section-background {
    background-image: url(https://static1.squarespace.com/static/5f29fbcbcc1280320f186bfe/t/5fb53a78a960184392c4446a/1605712517183/wanted+02.png) !important;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}
}

The data-section-id seemes to work (even though I was worried to find it) but when I load the page, the image  appears just for a moment and then the old image shows and stays when its fully loaded.

I have no idea what to do now, I feel like I'm almost there but I'm not haha. Please help!
@tuanphan

Link to post
  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

1 answer to this question

Recommended Posts

  • 0
@media screen and (max-width:767px) {
[data-section-id="5fa2232697ec03254a90eb09"] .section-background-canvas {
    visibility: hidden;
}
[data-section-id="5fa2232697ec03254a90eb09"] .section-background {
    background-image: url(https://static1.squarespace.com/static/5f29fbcbcc1280320f186bfe/t/5fb53a78a960184392c4446a/1605712517183/wanted+02.png) !important;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}
}

Use new code, here I changed .section-background img tag to .section-background-canvas

You can send your question to my email to get detail answer. / How to Setup Password & Share URL

--- Happy New Year

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...