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

Different Banner Image on Mobile

Question

Hello! So my site is  https://earthlycraft.co/

It's almost there... but i cant work one thing out. How to change one of my banner hero images for mobile. It looks great on desktop however its too small on mobile,  so i have another logo ready thats zoomed right in that i'd like to use for mobile only. I've added the file in design > custom css > manage custom files so i can use the link to the file

I'm fairly familiar with media queries but i don't know the code to change the banner. When I inspect I get this code:

.sqs-block-image .image-block-outer-wrapper:not(.image-block-v2) .intrinsic .image-block-wrapper img

Therefore i'm going for something along the lines of:

@media only screen and (max-width: 600px) {.sqs-block-image .image-block-outer-wrapper:not(.image-block-v2) .intrinsic .image-block-wrapper img {background image: https://static1.squarespace.com/static/5d00032088447c0001487495/t/5dcdc90c40062f0cf29e9ddc/1573767446853/mobilelogo.png;}}

Help would be much appreciated!!

Cheers!!

 

 

Share this post


Link to post

2 answers to this question

Recommended Posts

  • 1

Hi @Joeyearthly,

If you are using an index page, I have a different workaround that I like a bit better, since you can make whole area specific for mobile instead of just the banner image. I create two "sub-pages" at the top of the index page, one for desktop view (with the URL slug home-banner) and one for mobile view (with the URL slug home-banner-mobile). Then I add the following code to Custom CSS. (Note that if you want to edit the mobile from your desktop, you'll need to briefly comment out the code so you can see that page on desktop.)

/* show home page block dependent on screen size */ 
@media only screen and (max-width: 780px) { #home-banner { display: none; } } 
@media only screen and (min-width: 781px) { #home-banner-mobile { display: none; } }

 

Share this post


Link to post
  • 0

Hey @christyprice

Thank you so much for this! Great workaround thats done exactly what I wanted it to! That's some outside the box thinking right there...great stuff!

It has presented a bit of a problem though, in that I still don't know how to call the banner image. The container for the image is too darn small and it just cuts off the edges top and bottom of any image I put there....so the bigger zoom image idea isn't working perfectly, yet. If you have any ideas on this code do let me know!

So far, without joy, i've tried 

.sqs-block-html  , .sqs-block-image, .sqs-block-html , .sqs-block-markdown blockquote, .image-block-outer-wrapper:not(.image-block-v2) .intrinsic .image-block-wrapper img

and I just cant get that container to move.

Share this post


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...