All things Shopify and commerce
Hi!
I am trying to set my button width to a consistent value regardless of the text length. Right now, my buttons are changing size dependent on text length, which is fine for most pages of my website, but I want to create a quick links page where all buttons are set to the same size.
Right now, I have all of the buttons in different rich text sections where I have been trying to edit the custom CSS, but changing width alters the alignment of the entire button section to the right.
I attached an image showing the ideal button width alignment and an image showing what it looks like now. Does anyone know how I can accomplish this without adding longer text (such as the dots to fill the space)?
Thank you!
You can wrap all <button> tags in a parent <div class="parent"> tag and add the below CSS
div.parent {
width: 300px;
}
div.parent > button {
display: block;
width: 100%;
}
Found my reply helpful? Click Like to let me know!
Got your question answered? Mark it as an Accepted Solution.
Interested in working together? Contact Us Now!
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025