Jump to content

Any tips for getting blocks of code to appear side by side in mobile view?

Recommended Posts

Posted

Site URL: https://amalfimedia.com/binge-test/3qf81s6jhgfr6aswexviakq9yyhe96-sg6rx-fyacd

Hello all!

So I have 4 "listen on" badges at the top of my blog for things apple podcasts, spotify, stitcher, and google podcasts. I've attached how they look on desktop and how they look on mobile. They are code element. Does anyone know how I can make the badges on mobile stack the same way they do on desktop? I'd like for Apple pod & spotify to be next to each other; google pod and stitcher next to each other. On mobile they all stack on top of each other.

Thanks for the help! 

Desktop.png

Mobile.png

  • Replies 3
  • Views 595
  • Created
  • Last Reply
Posted
16 hours ago, TheNattyD said:

Site URL: https://amalfimedia.com/binge-test/3qf81s6jhgfr6aswexviakq9yyhe96-sg6rx-fyacd

Hello all!

So I have 4 "listen on" badges at the top of my blog for things apple podcasts, spotify, stitcher, and google podcasts. I've attached how they look on desktop and how they look on mobile. They are code element. Does anyone know how I can make the badges on mobile stack the same way they do on desktop? I'd like for Apple pod & spotify to be next to each other; google pod and stitcher next to each other. On mobile they all stack on top of each other.

Thanks for the help! 

Desktop.png

Mobile.png

Use this css


@media only screen and (max-width: 600px) {
      #block-8fa1184a2f92463bd584 + .row .span-2,
      #block-8fa1184a2f92463bd584 + .row .span-10{
         width: 50% !important;
        float: left !important;
      }
      #block-8fa1184a2f92463bd584 + .row + .row .span-2,
      #block-8fa1184a2f92463bd584 + .row + .row .span-10{
         width: 50% !important;
        float: left !important;
      }
}


@media only screen and (min-width: 600px) and (max-width: 768px) {
      #block-8fa1184a2f92463bd584 + .row .span-2,
      #block-8fa1184a2f92463bd584 + .row .span-10{
         width: 30% !important;
        float: left !important;
      }
      #block-8fa1184a2f92463bd584 + .row + .row .span-2,
      #block-8fa1184a2f92463bd584 + .row + .row .span-10{
         width: 30% !important;
        float: left !important;
      }
}

image.png.16b3fe445ef546d56db5b36748785fc6.png

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Pinch/Zoom images, videos - PDFs Lightbox - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> 🤖 Ask me anything

Posted
6 hours ago, bangank36 said:

Use this css



@media only screen and (max-width: 600px) {
      #block-8fa1184a2f92463bd584 + .row .span-2,
      #block-8fa1184a2f92463bd584 + .row .span-10{
         width: 50% !important;
        float: left !important;
      }
      #block-8fa1184a2f92463bd584 + .row + .row .span-2,
      #block-8fa1184a2f92463bd584 + .row + .row .span-10{
         width: 50% !important;
        float: left !important;
      }
}


@media only screen and (min-width: 600px) and (max-width: 768px) {
      #block-8fa1184a2f92463bd584 + .row .span-2,
      #block-8fa1184a2f92463bd584 + .row .span-10{
         width: 30% !important;
        float: left !important;
      }
      #block-8fa1184a2f92463bd584 + .row + .row .span-2,
      #block-8fa1184a2f92463bd584 + .row + .row .span-10{
         width: 30% !important;
        float: left !important;
      }
}

image.png.16b3fe445ef546d56db5b36748785fc6.png

You are amazing! Follow up question, if I did this for 100+ blog posts would it dramatically slow down my website? I know how to customize the code for each blog post but I also don't want to jeopardize the user loading experience. Thanks so much for a solution 🙂

Posted
2 minutes ago, TheNattyD said:

You are amazing! Follow up question, if I did this for 100+ blog posts would it dramatically slow down my website? I know how to customize the code for each blog post but I also don't want to jeopardize the user loading experience. Thanks so much for a solution 🙂

If you x100 this snippet it may add ~100kb to the site, i dont think it effect that much. But if you are after the most effective way, then javascript may need to be used

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Pinch/Zoom images, videos - PDFs Lightbox - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> 🤖 Ask me anything

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.