We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Image layout consistency on mobile in the product page description

Image layout consistency on mobile in the product page description

AroonaSurf
New Member
10 0 0

IMG_6535.PNG

IMG_6536.PNG

  Hi All - A tricky one. I want these images that I have uploaded in the product description sections to appear consistent when viewed on mobile. The First screenshot shows them jumbled and the second screenshot is how I want them to look. I believe I need to change something in the coding but am not sure what.  Thanks for any help!

 

AroonaSurf_1-1724130774750.png

AroonaSurf_2-1724130806065.png

 

 

Replies 9 (9)

Shadab_dev
Shopify Partner
1583 83 173

@AroonaSurf hi. open your theme code editor and look for core.css file or base.css file. Scroll to the bottom of the file and add this code.

@media(max-width:767px){

.product-section .wpb_wrapper .vc_figure{

        display: grid;

       grid-template-columns: repeat(2, 1fr);

}

}

I hope this does what you are looking for.

Buy me Coffee, if you feel i was helpful. Email Me here or WhatsApp me with this link for any help with shopify theme customizations or any project in web dev. If this is helpful, please Like and Accept the solution.
AroonaSurf
New Member
10 0 0

Hi Shadab, thanks for the quick response.

 

That doesn't seem to have worked. I've attached a screenshot to make sure I've done it correctly: 

AroonaSurf_0-1724133738609.png

Could It be to do with the product description HTML, as this is where the images are inserted?

 

Thanks

 

Shadab_dev
Shopify Partner
1583 83 173

Nah I don't think that would matter even though you have added html that is on the page so css should affect them 

 

May be try adding !important to the code 

 

Change the part to this

 

display: grid !important;

 grid-template-columns: repeat(2, 1fr) !important;

 

If this does not help, please try sending a clear picture of the html or i might need access to your store since I cannot check on my development store as you are using a paid plugin i believe 

Buy me Coffee, if you feel i was helpful. Email Me here or WhatsApp me with this link for any help with shopify theme customizations or any project in web dev. If this is helpful, please Like and Accept the solution.
AroonaSurf
New Member
10 0 0

Hey Shadab, That doesn't seemed to have worked either - the images are still jumbled.

 

This is the HTML for the 6 images below:

 

<div class="feature-container"><a title="" href="https://www.nspsurfboards.com/our-dealers/" class="vc_general vc_btn3 vc_btn3-size-md vc_btn3-shape-rounded vc_btn3-style-modern vc_btn3-block vc_btn3-color-grey" target="_blank"></a><img alt="" src="https://cdn.shopify.com/s/files/1/0764/7504/0060/files/1600x1600_Butter_Knife_8_6_White_-_HDT_-_Deta..." width="150" height="150"><img alt="" src="https://cdn.shopify.com/s/files/1/0764/7504/0060/files/1600x1600_Butter_Knife_8_6_White_-_HDT_-_Deta..." width="150" height="150"><img alt="" src="https://cdn.shopify.com/s/files/1/0764/7504/0060/files/1600x1600_Butter_Knife_8_6_White_-_HDT_-_Deta..." width="150" height="150"><br></div>
<div class="feature-container"><img alt="" src="https://cdn.shopify.com/s/files/1/0764/7504/0060/files/1600x1600_Butter_Knife_Mint_-_HDT_-_Detail_Fi..." width="150" height="150"><img alt="" src="https://cdn.shopify.com/s/files/1/0764/7504/0060/files/1600x1600_Butter_Knife_Mint_-_HDT_-_Detail_De..." width="150" height="150"><img alt="" src="https://cdn.shopify.com/s/files/1/0764/7504/0060/files/1600x1600_Butter_Knife_Mint_-_HDT_-_Detail_Da..." width="150" height="150"></div>

 

Thanks for the help.

Shadab_dev
Shopify Partner
1583 83 173

@AroonaSurf sorry for all the fail tries but sometimes its just like that, if this was a free theme iwould have tried it on my development store. the code is correct, lets give it a shot and try adding this under base.css file all the way down after everything. also i see the mobile version is a bit off since your size chart goes out of the page it makes entire page scrollable which is not a very good practice in my opinion, so i have added the code here in between // size chart css, size chart css end*/. if you dont like it remove it.

 

@media(max-width:767px){

.product-section .wpb_wrapper .vc_figure{

        display: grid !important;

       grid-template-columns: repeat(2, 1fr) !important;

}

//  size chart css

.product-section table{

overflow-x: scroll;

 height: 100%;

display: block;

width: 100% !important;

}

//  size chart css end

 

 

}

Buy me Coffee, if you feel i was helpful. Email Me here or WhatsApp me with this link for any help with shopify theme customizations or any project in web dev. If this is helpful, please Like and Accept the solution.
AroonaSurf
New Member
10 0 0

Don't apologise thanks for helping. 

 

I can't seem to find the base.css file in the theme code editor - can you direct me to it?

 

thanks

Shadab_dev
Shopify Partner
1583 83 173

Pretty much the same way you found core.css so searching for it in the theme code editor. if you cannot find that try looking for main.css or style.css. 

 

Buy me Coffee, if you feel i was helpful. Email Me here or WhatsApp me with this link for any help with shopify theme customizations or any project in web dev. If this is helpful, please Like and Accept the solution.
AroonaSurf
New Member
10 0 0

None of those files are showing up (base, main or style): 

AroonaSurf_0-1724304358568.png

Could it be main navigation css? Thanks

 

Shadab_dev
Shopify Partner
1583 83 173

Honestly @AroonaSurf I know this is the code which will do it. But as I told you this is how it gets sometimes. If you don't mind giving me a collaborator access to your store I would definitely look for the right place to put this.

 

Wouldn't have asked if only you were on a free theme. Up to you to make this easier for the both of us or else I wouldn't mind trying a bit more this way itself.

 

Thanks

Buy me Coffee, if you feel i was helpful. Email Me here or WhatsApp me with this link for any help with shopify theme customizations or any project in web dev. If this is helpful, please Like and Accept the solution.