How to center custom button on page

I recently added a button that opens up a contact form modal. The box shows up on the very left when on the contact page. Need a method that keeps the button centered no matter the display width.

Also the code is added through custom liquid section in theme customization.

url: cureblame.com

password: shhhbequiet

Hi @cureblame ,

Step 1: Go to Shopify Admin → Online Store ->Theme → Edit code

Step 2: Search file base.css, theme.css, styles.css or theme.scss.liquid

Step 3: Insert the below code at the bottom of the file → Save

div:has(#myBtn) {
    text-align: center !important;
}

Here is result:

Hope this can help you,

If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you :heart_eyes:

Hi @cureblame

Step 1. Go to Admin → Online store → Theme > Edit code

Step 2. Find the file base.css. Append the following CSS snippet to the end of the file.

div:has(>#myModal) {
    text-align: center !important;
}

Result

Have a nice day