moving a button to the middle

Hello,

ive created a custom liquid, a simple button. im trying to place it in the center but dont know how.

i just need to move it a bit to the left.

the store url is: padpal.co.il

thank you!

1 Like

@OriHacohen on which page is this section?

here it is:

https://padpal.co.il/products/104-%D7%9E%D7%A7%D7%A9%D7%99%D7%9D-%D7%9C%D7%9E%D7%A7%D7%9C%D7%93%D7%AA-%D7%9E%D7%9B%D7%A0%D7%99%D7%AA-%D7%92%D7%95%D7%93%D7%9C-100

sorry

here is the code inside the custom liquid:

  • Here is the solution for you @OriHacohen
  • Please follow these steps:

  • Then find the base.css or theme.css file.
  • Then add the following code at the end of the file and press ‘Save’ to save it.
.product__info-container .button.button--primary {
 margin-left: 20% !important;
    margin-right: 20% !important;
}
  • Here is the result you will achieve:

  • Please press ‘Like’ and mark it as ‘Solution’ if you find it helpful. Thank you.

@OriHacohen - in that custom code you have classes for button, can you please one more class like ‘custom_class’ to it? so we can set css for this particular button

Hi @OriHacohen

Could you modify the liquid code to the following?

[עצב-בעצמך](https://padpal.co.il/products/100-104k)

The result

If it’s helpful, please like and mark it as a solution, thank you :face_blowing_a_kiss:

1 Like

thank you for the help! i do have one question tho, im using this button for 5 different product, and so i need to insert a different url inside each button. but it seems to be the same in all product pages. i could make 5 different product templates but i prefer not to, maybe its possible to insert a dynamic field to each button somehow? and different url to each button?

Hi @OriHacohen

You can do that with metafields. Learn more about it here https://shopify.dev/docs/apps/build/custom-data

Have a nice day