How to Make Squarespace Buttons the Same Size Side by Side
Easy copy-paste solution
•
Easy copy-paste solution •
Perfectly aligned buttons next to each other
Free Css Code Snippet
Two buttons next to each other should match. In Squarespace 7.1 they often don't: one is wider, the text wraps onto two lines on mobile, or the words touch the edges of the button. One CSS snippet fixes all three, and the buttons stay matched on desktop, tablet and mobile, without fixed widths.
Before
After
Problem aligning two buttons next to each other perfectly in Squarespace?
If you've placed two buttons side by side in Squarespace, you've probably seen at least one of these:
The buttons are different sizes, because each button is as wide as its own text. "Get in touch" and "View my work" never quite match.
The button text wraps onto two lines on tablet or mobile, even though it fits on one line on desktop.
The text touches the edges of the button once it wraps, as if the button has no padding at all.
The button padding setting seems to do nothing when you try to fix it in Site Styles.
In the Fluid Engine editor, each button block has two width settings, and each one causes part of the problem:
BUTTON SET TO FIT
keeps nice padding, but the button hugs its text. Two buttons with different labels end up different sizes.
BUTTON SET TO FILL
makes both buttons match the block, so they line up perfectly. But on smaller screens the text wraps and touches the edges.
COMMON FIXES AND WHY THEY BREAK
| What people try | What happens next |
|---|---|
| Giving the buttons a fixed width or min-width | Looks perfect on your laptop. Then you check on a tablet and the buttons push into each other or the block next to them. |
Adding white-space: nowrap so the text stays on one line |
The text does stay on one line, but on a small phone it simply runs out of the button. |
| Dragging the button blocks wider | Buys you a little room, but the layout starts to look off balance, and on smaller screens the text wraps again anyway. |
| Shortening the button labels | Sometimes the right call. But you shouldn't have to rewrite "Get to know me" just because of a button. |
So here's what works instead: keep both buttons on Fill so they always match, and give them back the padding Squarespace takes away. When the text needs two lines, the button just grows a little taller, the way you'd expect, on desktop, tablet and mobile.
Why it happens
Squarespace sets the top and bottom padding of Fill buttons to 0. Fit buttons keep theirs.
The width isn't the real issue. The Fluid Engine grid already lets a row grow taller when its content needs more room. That's why a Fit button quietly grows into two lines on smaller screens.
A Fill button never grows, because with zero padding its text always fits the block height. Give it padding back and it grows exactly like a Fit button, while keeping the full width of its block.
The simple Copy-paste Fix
Copy this whole CSS snippet. It only affects buttons set to Fill; your Fit buttons stay as they are.
/* Fill buttons: keep padding on all sides, grow taller when text wraps. Live site only, so blocks don't keep growing in the editor. */ body:not(.sqs-edit-mode-active) .fe-block .sqs-block-button-container.sqs-stretched .sqs-block-button-element.sqs-block-button-element { box-sizing: border-box !important; height: auto !important; min-height: 100% !important; /* Adjust these to your fonts if needed */ padding-block: 0.9em !important; /* space above and below the text */ padding-inline: 0.8em !important; /* space left and right of the text */ line-height: 1.2 !important; /* space between two lines of wrapped text */ display: flex !important; align-items: center !important; justify-content: center !important; text-align: center !important; }
What each part of the CSS snippet does:
padding brings back space above, below and beside the text. The long selector is needed because Squarespace's own rule is stronger than a simple one.
height: auto and min-height: 100% let the button grow taller when the text wraps, but never get shorter than the block you drew.
display: flex with the align lines keeps the text centred on every screen size.
On large screens nothing changes. The difference only shows when the text starts to wrap.
The :not(.sqs-edit-mode-active) part switches the fix off while you edit. Without it, the editor measures the taller button and saves a bigger block every time you move something nearby.
How to install it
In your Squarespace dashboard, open Pages, scroll down and click Website Tools, then Custom CSS.
Paste the snippet at the end of anything already there.
Click Save. Easy to forget, and nothing works until you do.
In the page editor, set both buttons in a pair to Fill and make their blocks the same width.
Open the live page in a new browser tab and drag the window narrower to check it.
The editor preview doesn't always show custom CSS correctly, so always check on the live page.
Adjust to your fonts if needed. Every site uses different fonts and sizes, so the default values may look a little off on yours. If the buttons feel too tall or too tight, change padding-block (space above and below the text) and line-height (space between two lines of wrapped text) in small steps, for example 0.1 at a time, then save and check the live page again.
WORK
WORK
WITH ME
WITH ME
I’m known for creative designs with your story in mind.
FAQ
Why are my two Squarespace buttons different sizes?
With the Fit setting, each button is exactly as wide as its own text, so different labels give different widths. Switch both to Fill, make their blocks the same width, and add the CSS above.
Why does my button text wrap onto two lines on mobile?
The button block gets narrower as the screen gets smaller, and longer labels no longer fit on one line. With this fix the button grows taller instead of squashing the text.
Why does the button text touch the edges of the button?
Squarespace sets the top and bottom padding of Fill buttons to 0, so wrapped text fills the whole button. The CSS above puts the padding back.
Why is the button padding setting in Site Styles not working?
For Fill buttons, Squarespace's own rule overrides it. That's why the snippet uses a longer, stronger selector.
Will this change my Fit buttons?
No. The code only targets buttons set to Fill.
Will the buttons look different on desktop?
No, as long as the text fits on one line. The button only grows when the text wraps.
Can I change the amount of padding?
Yes. The code has two lines for it: padding-block sets top and bottom, padding-inline sets left and right. Higher numbers mean more space. 1em equals the size of your button text, so the padding grows and shrinks with it.
Does it work on mobile?
Yes. Squarespace keeps a separate mobile layout, and the code applies there too.
Why not just make the buttons wider?
You can, but it often looks out of balance with the rest of the layout. This fix keeps your design as you drew it.
YOU MAKE ALSO LIKE THIS ANIMATIONScattered text animation on scroll gives your key message the attention it deserves.
Movement catches the eye, so visitors slow down at the one sentence you most want read: your offer, your promise, your story. Every word settles as they scroll, which keeps them on the page longer and makes your message stick.
Beginner-friendly. No plugin. No developer.
No subscription. Instant download. Setup guide included.