Jump to content

How to prevent button overlap when resizing window?

Recommended Posts

Posted

Site URL: https://bonjrmusic.com/music

Hello,

I have 4 buttons in a single row on the website page linked. However, when I resize the window, some of the buttons end up overlapping. How does one prevent this behavior?

I'm also noticing the header links ('home', 'music', 'videos', etc.) become two rows as the window size gets smaller. Looking around at other websites, it seems that they maintain a single row and adjust according to the window size by either having the links remain fixed (which i'm actually seeing with the squarespace forum header), scaling down (youtube) or trimming the content (soundcloud). Does anyone know the code for each of these three different approaches so I could test it out?

Appreciate any help I can get!

Thanks,
Daniel

  • Replies 4
  • Views 3.9k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Posted
On 4/12/2022 at 10:27 AM, thefakedaniel said:

Site URL: https://bonjrmusic.com/music

Hello,

I have 4 buttons in a single row on the website page linked. However, when I resize the window, some of the buttons end up overlapping. How does one prevent this behavior?

I'm also noticing the header links ('home', 'music', 'videos', etc.) become two rows as the window size gets smaller. Looking around at other websites, it seems that they maintain a single row and adjust according to the window size by either having the links remain fixed (which i'm actually seeing with the squarespace forum header), scaling down (youtube) or trimming the content (soundcloud). Does anyone know the code for each of these three different approaches so I could test it out?

Appreciate any help I can get!

Thanks,
Daniel

Try adding to Home > Design > Custom Css

#block-yui_3_17_2_1_1648729481274_4469 + div > .col:not(.span-0) {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 20% !important;
} 
#block-yui_3_17_2_1_1648729481274_4469 + div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

@media only screen and (max-width: 1203px) {
  #block-yui_3_17_2_1_1648729481274_4469 + div > .col:not(.span-0) {
    width: 100% !important;
  } 
}

My codes will arrange these buttons into one column if you resize the width of your browser.

Let me know how it works on your site

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 (edited)
3 hours ago, bangank36 said:

Try adding to Home > Design > Custom Css

#block-yui_3_17_2_1_1648729481274_4469 + div > .col:not(.span-0) {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 20% !important;
} 
#block-yui_3_17_2_1_1648729481274_4469 + div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

@media only screen and (max-width: 1203px) {
  #block-yui_3_17_2_1_1648729481274_4469 + div > .col:not(.span-0) {
    width: 100% !important;
  } 
}

My codes will arrange these buttons into one column if you resize the width of your browser.

Let me know how it works on your site

Thanks,

I just tried it out and here is the behavior I am seeing:

https://i.gyazo.com/7f5ac9282d56d4ccbeb819d125f65d13.mp4

Still a bit of overlap before it snaps into the column, not sure if that's what you intended.

Edited by thefakedaniel
  • 1 month later...
Posted
8 hours ago, allenandcocreative said:

Hello!

I'm having a similar issue with a site I designed for a client: https://brickandmantel.com

When resizing the browser window, the menu items overlap. My client is not happy with this and I'm not sure how to figure out the CSS to fix this. I'm hoping you perhaps can help,with a version of css that would work for my site? Any help would be greatly appreciated.

Best,

Shelly

How about reduce font size, or force burger menu appear on these screen sizes? If you like this, we will try checking & give the code

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Create an account or sign in to comment

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

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