Jump to content

Center button vertically, adjust for mobile

Recommended Posts

Site URL: https://paperwork-co.squarespace.com/paperwork-for-credit-unions

I was able to figure out the code to center a button vertically within a block but I can't figure out how to not make it centered on mobile. Right now it overlaps the text. Can anyone help? 

This is the code I am using:

#block-f929a95afe532c3b9f3a {
  vertical-center: margin: 0;
  position: absolute;
  top: 50%;
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
}

Screen Shot 2022-05-12 at 3.40.18 PM.png

Link to comment
  • Replies 2
  • Views 564
  • Created
  • Last Reply

Top Posters In This Topic

Add to Design > Custom CSS
 

/* Schedule button mobile */
@media screen and (max-width:767px) {
div#block-f929a95afe532c3b9f3a {
    position: static !important;
    transform: unset !important;
}
div#block-f929a95afe532c3b9f3a div {
    text-align: left;
}}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

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.