Jump to content

How to make buttons the same size/width in tablet view

Recommended Posts

Site URL: https://typeAprofessionals.com

Hi all,

I have two large side-by-side buttons at the bottom of my home page, with a spacer on each side to make them more centered on the page. The buttons are the same width as each other and look fine in desktop and mobile view.

However, in tablet view, the "order form" button is slightly narrower than the "file upload" button and it looks bad that they're not the same width. I believe button width in tablet view is being determined by their text labels, and "file upload" is one character longer than "order form."

If I remove one letter from the "file upload" button, then they're the same width in tablet view. But obviously I want to keep the labels as is. I also noticed that if I remove the spacers, then they're the same width in tablet view, but I don't want to do this either because I like them more centered.

I've searched the forum on this but haven't found a solution. If anyone can come up with one using CSS, it would be much appreciated! Thanks in advance!

Link to comment
  • Replies 4
  • Views 2.3k
  • Created
  • Last Reply
On 4/11/2021 at 4:04 AM, pixies1 said:

Site URL: https://typeAprofessionals.com

Hi all,

I have two large side-by-side buttons at the bottom of my home page, with a spacer on each side to make them more centered on the page. The buttons are the same width as each other and look fine in desktop and mobile view.

However, in tablet view, the "order form" button is slightly narrower than the "file upload" button and it looks bad that they're not the same width. I believe button width in tablet view is being determined by their text labels, and "file upload" is one character longer than "order form."

If I remove one letter from the "file upload" button, then they're the same width in tablet view. But obviously I want to keep the labels as is. I also noticed that if I remove the spacers, then they're the same width in tablet view, but I don't want to do this either because I like them more centered.

I've searched the forum on this but haven't found a solution. If anyone can come up with one using CSS, it would be much appreciated! Thanks in advance!

try

@media only screen and (min-width: 600px) and (max-width: 992px) {
  #get-started .sqs-block-button-element {
    width: 90px;
  }
}

image.thumb.png.96c80d2a6028617347f31deeb4aa9122.png

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

Hi bangank36, thank you! The buttons are now the same size, thanks to your code. I adjusted the width to add a little spacing between the buttons and I added a left margin to get them centered correctly on the page:

margin-left: -5px;
width: 75px;

However, now the words "FILE UPLOAD" are not centered in the second button. Any idea how to correct this? Maybe I should have centered the buttons a different way than adding "margin-left"?

Screen Shot 2021-04-13 at 9.52.00 AM.png

Link to comment
18 hours ago, pixies1 said:

Hi bangank36, thank you! The buttons are now the same size, thanks to your code. I adjusted the width to add a little spacing between the buttons and I added a left margin to get them centered correctly on the page:

margin-left: -5px;
width: 75px;

However, now the words "FILE UPLOAD" are not centered in the second button. Any idea how to correct this? Maybe I should have centered the buttons a different way than adding "margin-left"?

Screen Shot 2021-04-13 at 9.52.00 AM.png

Hi. It looks fine here. Did you solve the probleM?

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!)

Link to comment

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.