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.3k
  • 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


💻 Can't figure something out and want to learn? 💁‍♀️ 1-2-1 Squarespace session 
👩‍💻 Need some customisation for a design? 💁‍♀️ Custom Code help
 Did I help? 💁‍♀️ I like coffee

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


💻 Can't figure something out and want to learn? 💁‍♀️ 1-2-1 Squarespace session 
👩‍💻 Need some customisation for a design? 💁‍♀️ Custom Code help
 Did I help? 💁‍♀️ I like coffee

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


💻 Can't figure something out and want to learn? 💁‍♀️ 1-2-1 Squarespace session 
👩‍💻 Need some customisation for a design? 💁‍♀️ Custom Code help
 Did I help? 💁‍♀️ I like coffee

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.