Skip Navigation

[Resolved] Make row of buttons same size

This support ticket is created 2 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 6 replies, has 2 voices.

Last updated by davidF-23 2 years, 11 months ago.

Assisted by: Waqar.

Author
Posts
#2310877
mobile button size.png
desktop button size.png
button layout.png

Hello - I have a grid with conditional buttons (links). Each button has different text, and the number of characters varies slightly.

I can't figure out how to make the buttons the same size regardless of how many characters there are. Also on mobile I have one button getting squished that I can't figure out.

I looked for some CSS but couldn't fix it. Let me know, thanks!

#2311161

Hi,

Thank you for contacting us and I'd be happy to assist.

I can share some CSS code examples, but, I'll need to see the page with these buttons. Can you please share the link where these buttons can be seen?

regards,
Waqar

#2311681

Sure no problem, it's hidden link

#2311903

Thank you for sharing the link.

You can include the following custom CSS code in the template:


.wp-block-toolset-blocks-grid .tb-grid-column .tb-button .tb-button__link {
    width: 95%;
    height: 100%;
    padding: 0.7em 0.5em 0.5em;
    vertical-align: middle;
}

#2315755
chrome_vqhgyiXFWR.png

Thanks, that helped the width but now the text on the buttons is aligning towards the top:

#2316217

Thanks for the update.

I've checked buttons in Chrome, Safari, and in Firefox browsers, but the text appears to be centered correctly.
( screenshot: hidden link )

You can test this again after clearing all involved caches and feel free to adjust the top padding value '0.7em' in the code, as needed.

#2317917

Thanks, that did the trick.