Custom Liquid - Center and vary with screen width

Hi,

I have created the below custom liquid for a section on a page to have images of catalogue covers to link to their own page; however, they don’t vary with the size of the page like the rest of the template.
Can anyone help me out please? Eventually, each image will have its own HTML link.

I would also like each line of images centred, and to only have 4 images/links to a line?

I hope this all makes sense.

<img src=“https://cdnc.heyzine.com/flip-book/cover/ff1e8d4708.jpg” class="fp-thumb"style=“border: 1px solid lightgray; box-shadow: lightgray 0px 0px 4px 1px; width: 350px; margin-left: 10px; margin-right: 30px;”>

<img src=“https://cdnc.heyzine.com/flip-book/cover/ff1e8d4708.jpg” class="fp-thumb"style=“border: 1px solid lightgray; box-shadow: lightgray 0px 0px 4px 1px; width: 350px; margin-left: 10px; margin-right: 30px;”>

<img src=“https://cdnc.heyzine.com/flip-book/cover/ff1e8d4708.jpg” class="fp-thumb"style=“border: 1px solid lightgray; box-shadow: lightgray 0px 0px 4px 1px; width: 350px; margin-left: 10px; margin-right: 30px;”>

Here is the actual page link

Thanks!

hey @media_by_bec try this one by follow these steps
Go to online store ----> themes ----> go to three Dots ----> edit code ---->find theme.liquid files ----> place the code ---->before the </body>tag if this code work please do not forget to like and mark it solution

<style>
.section-template--20587914100790__custom_liquid_wYHzMU-padding {
    display: flex !important;
    justify-content: center !important;
}
</style>

Hi @media_by_bec

In your Shopify Admin go to online store > themes > actions > edit code
Find Asset > base.css and paste this at the bottow of the file:

.section-template--20587914100790__custom_liquid_wYHzMU-padding{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:20px;
}

Awesome thank-you!!! When the screen gets small, the rest of the page stacks. What do I need to add for this to do the same please?