How can I center align a banner in a custom Liquid section?

I pasted HTML code for a banner in a Custom Liquid Section in Dawn. Unfortunately, it’s not center aligned when it displays. Please, tell me an easy way to make this work. I’m a newbie with limited HTML knowledge. Thanks.

@maortegar

Sorry you are facing this issue, it would be my pleasure to help you.

Welcome to the Shopify community! :blush:
Thanks for your good question.

Please share your site URL,
I will check out the issue and provide you a solution here.

www.sempervaco.com

The banner is here: https://sempervaco.com/blogs/quisqueya-blog The resort banner with the 15% off offer. Thanks.

Hi @maortegar ,

You can use the follow code below.

  1. From your Admin store, go to Online store > Themes > Click Actions > Edit code
  2. Open the Asset folder, and find the base.css file.
  3. Add the code below.
section-template--16233735717105__1657999238d52d92d1-padding {
    display: flex;
    justify-content: center;
}

no, that didn’t do the trick. I copied it at the end of the base.css file and nothing. I refreshed several times to no avail. Any other suggestions?

@maortegar Sorry. Missing the period.

.section-template--16233735717105__1657999238d52d92d1-padding {
    display: flex;
    justify-content: center;
}

You are the man. That did the trick. Thank you so much. :grinning_face: :+1:

Hiya, do you mind me asking if this work for any website? I have the same issue and use dawn theme, www.lateliernammaadi.com, I am not good at all at understanding coding. I added a custom liquid to have a h1 tag on my home page but I cannot align the text to the centre. Thank you for any help you can provide.