Jump to content

Button CSS with drag to enlarge feature

Recommended Posts

Hey Forum, I have a client that wants cloud buttons, I've uploaded the image in Manage Custom Files and sized it properly. However, when I go into a page and edit the page, as I try to drag and drop (to make the button bigger or smaller) the image does not adjust.

How do I add CSS so that the cloud button can be made bigger or smaller with drag and drop (when editing) and for mobile? Here is the code block I'm using:

.sqs-block-button .sqs-block-button-element--medium {    background-size: cover; width: 145px !important;    background-color: transparent !important;    background-image: url("https://static1.squarespace.com/static/63f63f087faed7328848a0f9/t/63f93a473b92ab032bfa4e47/1677277767327/Button+Color+%281%29.png");  background-size: 145px 75px;    background-repeat: no-repeat;    background-position: center;    color: gray;    }
.sqs-block-button .sqs-block-button-element--medium:hover {    color: #CDB0EE;    background-color: white; 
  } 
.sqs-block-button .sqs-block-button-element--medium {  font-family: georgia;    color: #9191ED;    font-size: 16px;    letter-spacing: 0.5em;    line-height: 35px;  
}

Link to comment

Your site is private please set up a site-wide password.

Post the password here.

Adding a site-wide password does not allow anyone to alter your site. It only allows those with the password to see your site.

Please read the site-wide password and how to share a link documentation to understand how they work.

We can then take a look at your issue.

You may find How to post a forum question post useful.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

Let's start with the basic cloud button effect.

 

Here is the CSS for that.

.sqs-block-button {

  background-image : url( 'https://static1.squarespace.com/static/63f63f087faed7328848a0f9/t/63f93a473b92ab032bfa4e47/1677277767327/Button+Color+%281%29.png' );
  background-position : center;
  background-repeat : no-repeat;
  background-size : contain;
  
  }

I tied it to the button block but you can choose a deeper element in the block.

Once you have that sorted then you can build on it.

Let us know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
Quote

Now, how do I get the words to center in the middle of the image (button) with bottom alignment?

I don't have a solution for this issue.

@tuanphan Do you have an insight?

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

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.