Jump to content

Vertical Justify Text Center on Button Using CSS

Go to solution Solved by melody495,

Recommended Posts

Posted (edited)

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
  • Replies 6
  • Views 1.8k
  • Created
  • Last Reply

Top Posters In This Topic

Posted

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 Nerd
When I have time, I like to help on the Forum, but if you need my full attention, please send your request here.

Tools I use (affiliate links😞
📅Blog Date Format plugin (Free by BeyondSpace)
Lazy Load Summary Block plugin (by Squareswebsites
)
📜Privacy Policy & Cookie Consent plugin (10% off by Termageddon
)
📈SEO plugin for Squarespace (by SEOSpace
)

 Did I help? I like coffee (Thank you)

  • Solution
Posted
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 Nerd
When I have time, I like to help on the Forum, but if you need my full attention, please send your request here.

Tools I use (affiliate links😞
📅Blog Date Format plugin (Free by BeyondSpace)
Lazy Load Summary Block plugin (by Squareswebsites
)
📜Privacy Policy & Cookie Consent plugin (10% off by Termageddon
)
📈SEO plugin for Squarespace (by SEOSpace
)

 Did I help? I like coffee (Thank you)

Posted
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 Nerd
When I have time, I like to help on the Forum, but if you need my full attention, please send your request here.

Tools I use (affiliate links😞
📅Blog Date Format plugin (Free by BeyondSpace)
Lazy Load Summary Block plugin (by Squareswebsites
)
📜Privacy Policy & Cookie Consent plugin (10% off by Termageddon
)
📈SEO plugin for Squarespace (by SEOSpace
)

 Did I help? I like coffee (Thank you)

Posted (edited)

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

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.