Jump to content

Vertical Justify Text Center on Button Using CSS

Go to solution Solved by melody495,

Recommended Posts

I'm using Bedford 7.0. Here is the code I put into the header injection of my page:

<style>
/* Medium Buttons */
.sqs-block-button-element--medium {
 width: 70% !important;
 min-height: 46px;
}
</style>

Here's what my button grid looks like as a result: site buttons.png
How do I get it so that the text is always centered on each button? The two-line texts center nicely, but the one-line texts are too high. Also, if there is a better way to make an aesthetically-pleasing grid of buttons, please tell me how.

Edited by GeothermalCanada
Link to comment
  • Replies 6
  • Views 1.5k
  • Created
  • Last Reply

Top Posters In This Topic

Hi @GeothermalCanada, please share your website url and where these buttons are located so we can take a look

-------- > 👆 <---------- Please quote or @ me when replying, or I won't get a notification 

Melody | Squarespace Website Developer
e: melody@melodylee.tech


💻 💁‍♀️ 1-2-1 Squarespace Training session <- feeling stuck and want to learn?
👩‍💻 💁‍♀️ Website help <- send me your to-do list. From code to plugin to domain setup.
 Did I help? I like coffee (Thank you)
🧰 See the tools I use (contain affiliate links)


 

Link to comment
  • Solution
18 hours ago, GeothermalCanada said:

https://www.geothermalcanada.org/catalogue-menu

Just scroll down you'll find the buttons. I've rounded the edges.


Try adding this to Website -> Website Tools (under Not Linked) -> Custom CSS

.sqs-block-button .sqs-block-button-element--medium {
	display: flex;
	justify-content: center;
	align-items: center;
}

This will apply the changes to all buttons that is .sqs-block-button-element--medium.

Let me know how it goes.

-------- > 👆 <---------- Please quote or @ me when replying, or I won't get a notification 

Melody | Squarespace Website Developer
e: melody@melodylee.tech


💻 💁‍♀️ 1-2-1 Squarespace Training session <- feeling stuck and want to learn?
👩‍💻 💁‍♀️ Website help <- send me your to-do list. From code to plugin to domain setup.
 Did I help? I like coffee (Thank you)
🧰 See the tools I use (contain affiliate links)


 

Link to comment
1 hour ago, GeothermalCanada said:

Flawless! Thank you.

Your welcome!

-------- > 👆 <---------- Please quote or @ me when replying, or I won't get a notification 

Melody | Squarespace Website Developer
e: melody@melodylee.tech


💻 💁‍♀️ 1-2-1 Squarespace Training session <- feeling stuck and want to learn?
👩‍💻 💁‍♀️ Website help <- send me your to-do list. From code to plugin to domain setup.
 Did I help? I like coffee (Thank you)
🧰 See the tools I use (contain affiliate links)


 

Link to comment

One more thing I'm having trouble with: (Bedford 7.0)

https://www.geothermalcanada.org/corporate-members

Here's the code header injection I'm currently using to increase the height of the slideshow pane:

<style>
 .sqs-gallery-block-slideshow {
   height: 30vh
  }
</style>

I can't get the images in the slideshow to scale up to fill the pane. I'd like to be able to scale them up so that their width matches the width of the pane. All images should be centered vertically. For images that are taller than the pane when scaled up, I'm fine with them being cropped above and below. I want the aspect ratio of each image to stay intact (no stretching).

Thanks once again for any help.

Edit: nevermind, I started a new thread for this.

Edited by GeothermalCanada
Link to comment

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.