How use a image for a button background in Squarespace – 7 & 7.1 // Squarespace CSS Tutorial

Just getting started with Squarespace CSS? Awesome! šŸ˜ I want to teach you the basics ā€“ grab my free Getting Started Guide here šŸ‘‰ https://insidethesquare.co/learn
ā€”
šŸ„³ Ready to launch ? Use the code PARTNER10 for 10% off (affiliate code): https://insidethesquare.co/partner10
ā€”
šŸ’• Love this free Square space tutorial? You can donate via Paypal to help support my YouTube Channel https://www.paypal.com/paypalme/insidethesquare
ā€”
This tutorial was recorded in my 7.1 demo site but also works for older versions of Squarespace!
ā€”
This tutorial will show you how to use an image for a button background in Squarespace. A few important things to note before you copy and paste this into your own site:

ā†’ There is more than one way to do this! This is just one approach of many because code is super customizable.

ā†’ The codes I am using in the tutorial are for basic on-page buttons; small, medium, and large. It is SUPER important to know that there are so many other types of buttons! Form submit buttons, add to cart buttons, the button in the header of your website, etc etc ā€“ each one of these buttons goes by a unique code name and you need to know that name to assign the background image to that button. In my CSS cheat sheet, you can find button names unique for specific themes, like 7.1 header buttons, and major elements like forms, blogs, and more. To download a copy of the cheat sheet visit https://insidethesquare.co/css

ā†’ I recommend using an image you upload into your site files so you can make sure you have access to it; using an image hosted by someone else means that the owner could take it down or change it without you knowing, messing up all your hard work!

Here are the steps from the tutorial:
ā‘ Upload the image to your Squarespace website (Design ā†’ Custom CSS ā†’ Custom Files)
ā‘” Paste the code below in your Custom CSS (Design ā†’ Custom CSS)
ā‘¢ Replace the text image-url-here with your own image url from the custom files section, making sure to leave the individual quotation marks around the url itself.
ā‘£ Pat yourself on the back for creating a unique site with some custom code you rockstar! šŸ„³

ā†’ Here is the code for small buttons:
.sqs-block-button-elementā€“small{background-color:transparent!important; background-image:url(ā€˜image-url-hereā€™); background-size:contain!important; background-position:center;background-repeat:no-repeat!important}

ā†’ Here is the code for medium buttons:
.sqs-block-button-elementā€“medium{background-color:transparent!important; background-image:url(ā€˜image-url-hereā€™); background-size:contain!important; background-position:center;background-repeat:no-repeat!important}

ā†’ Here is the code for large buttons:
.sqs-block-button-elementā€“large{background-color:transparent!important; background-image:url(ā€˜image-url-hereā€™); background-size:contain!important; background-position:center;background-repeat:no-repeat!important}

ā†’ Add this line of code to make sure the button image wonā€™t change opacity on a hover:
Small button
.sqs-block-button-elementā€“small:hover{opacity:1!important; }

Medium button
.sqs-block-button-elementā€“medium:hover{opacity:1!important; }

Large Button
.sqs-block-button-elementā€“large:hover{opacity:1!important; }

ā†’ Add this line of code before the final bracket to give any PNG image a drop shadow, adjusting the px values and color codes to make it match your site style:
filter:drop-shadow(5px 5px 10px rgba(0,0,0,0.8)

ā€”
šŸ¤© Ready for more codes? The codes in this tutorial are just the beginning of all the cool things you can do with Custom CSS! When youā€™re ready to dive in and start customizing, you can use codes from my CSS Cheat Sheet. It has over 30 pages of code snippets and pro tips to help you get started. Download your copy šŸ‘‰ https://InsideTheSquare.co/css
ā€”
šŸ„³ Ready to launch ? Use the code PARTNER10 for 10% off (affiliate code): https://insidethesquare.co/partner10
ā€”
šŸ™‹ Need some help? Visit ā€‹https://insidethesquare.co/code-helpā€‹ to see my current support options.
ā€”
The term ā€œSquarespaceā€ is a trademark of Squarespace, Inc. This content is not affiliated with Squarespace, Inc. I just really love their platform ā™„
ā€”
#squarespace #squarespacecss #howto #customizesquarespace #css #squarespacetricks #squarespacehacks #squarespacetips

You May Also Like