Centering multiple photos in blogpost, theme Roam

Centering multiple photos in blogpost, theme Roam

bella3
Visitor
2 0 0

Hi all,

 

I've been struggling to make nice blog posts with our shopify theme (Roam). It doesn't let me add multiple photos next to each other and always creates really big and awkward spaces between the images. I understand it has to do with the HTML code, so I've tried rewriting it and almost got it to work on a laptop screen. Although, now the issue is that it looks ridiculous on a mobile screen instead. I will attach two photos showing how it looks on the laptop currently vs the mobile.Skärmavbild 2024-09-27 kl. 09.56.08.pngSkärmavbild 2024-09-27 kl. 09.55.53.png

 

I therefore need help with rewriting this script to make sure the photos adjust accordingly to whatever screen the user is on.

 

<div class="full-width-image-container">
<div class="image-container"><img src="image_1" alt="description" class="blog-image"> <img src="image_2" alt="description" class="blog-image"> <img src="image_3" alt="description" class="blog-image"></div>
</div>
<style><!--
.full-width-image-container {
width: 100vw;
position: center;
left: 50%;
right: 50%;
margin-left: -50vw;
margin-right: -50vw;
padding: 20px 0;
}
.image-container {
display: flex;
justify-content: flex;
align-items: center;
gap: 20px;
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
.blog-image {
width: 300px;
height: 300px;
object-fit: cover;
}
@media (max-width: 1200px) {
.image-container {
flex-wrap: wrap;
}
.blog-image {
width: calc(50% - 10px);
height: auto;
}
}
@media (max-width: 600px) {
.blog-image {
width: 100%;
}
}
--></style>

 

All help very much appreciated! I'm not a coder so I've used AI for help but it only got me this far. 

Cheers!

Replies 2 (2)

sakib_ShopiDevs
Shopify Partner
6 0 1

You can try this 

.blog-image {
width: 300px;
height: 300px;
object-fit: cover;
margin: 0 auto;
}
Found it helpful? Please like and mark the solution that helped you.
Slider Revolution - Create sliders, theme sections, banners, videos, pages, advanced animation, and social feeds.
Essential Grid Gallery - Create photo galleries, video galleries, portfolio galleries, product gallery, collection gallery and more.
EasyDisplay: Product Showcase - Easily display collections, related products, discounts, recently viewed items, and best sellers
bella3
Visitor
2 0 0

Thank you for your reply! 

 

It made the photos stay next to each other on the phone, and you had to scroll sideways to see them. So the issue is, I want them next to each other on a laptop screen, but on top of each other vertical on a mobile to fit a mobile screen nicely. Do you think that is possible?