How can I align all images in one line on mobile view?

Hello

I would like all my images to be on one line on mobile view

Mobile view

Desktop view

this is the code i currently have in place but it doesn’t seem to work

@media (max-width: 767px) {
.grid .grid__item {
width: 20%;
clear: none;
}
}

https://c2235f-4.myshopify.com/

password: atreck

I am using the Impulse theme

Thanks

1 Like

You need to use a smaller width ~15%.

20% or 5 items out of 100% is not the individual final calculated total-width there’s things like padding and margin or internal elements affecting dimensions.

this is what happens when i use 15%

it might be an issue with the padding?

Hi @TBS2022 ,

You can try this code by following these steps:

Step 1: Go to Online Store->Theme->Edit code.

Step 2: Search file theme.liquid

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


Hope my solution works perfectly for you!

Best regards,

Oliver | PageFly

Hi @TBS2022

Please follow the instructions below

  • From your Shopify admin dashboard, click on “Online Store” and then “Themes”.
  • Find the theme that you want to edit and click on “Actions” and then “Edit code”.
  • In the “Assets” folder, click on “base.css, style.css or theme.css” file, depending on which file your theme uses to store its CSS styles. At the bottom of the file, add the following CSS code:
@media only screen and (max-width: 1200px) {
.grid.grid--flush-bottom {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    width: 100%;
}

.grid__item.text-center.aos-init.aos-animate {
    width: 100% !important;

}
}

Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!

1 Like

You are a superstar :folded_hands: