Karen_Ruby Posted July 10 Posted July 10 Hello, could someone clever help me with a change to my site's gallerys? They have always worked with the below code to force either gallery as 2 mobile/4 desktop items. Now I'm finding they can trip to 3 dependant on window size. Has something changed? Thanks for any help in advance. Karen /*Grid Galleries*/ /*Set galleries 2 columns on small tablets & mobile*/ @media screen and (max-width:767px) { /*Home page*/ #collection-5f0838d6114117107d0633a7, /*Portfolio page*/ #collection-5f0dc75be4b78a3c97a770d6, /*Commissions page*/ #collection-5f084534dd6f773fb0a43fb9 { .gallery-grid--layout-grid .gallery-grid-wrapper { grid-template-columns: repeat(2,auto) !important; } } } @media screen and (min-width:768px) { /*Home page*/ #collection-5f0838d6114117107d0633a7, /*Portfolio page*/ #collection-5f0dc75be4b78a3c97a770d6, /*Comissions page*/ #collection-5f084534dd6f773fb0a43fb9 { .gallery-grid--layout-grid .gallery-grid-wrapper { grid-template-columns: repeat(4,auto) !important; } } }
Lesum Posted July 10 Posted July 10 @Karen_Ruby Hi! Can you share your site URL for context? Karen_Ruby 1 If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. Sam Web Developer & Digital Designer ☕ Did you find my contribution helpful? Buy me a coffee?
Karen_Ruby Posted July 11 Author Posted July 11 Hi Sam, Apologies I thought the URL was included: https://www.karenyeomans.com/
Karen_Ruby Posted July 11 Author Posted July 11 I want the gallerys to be restricted to either 2 or 4 only
Solution Lesum Posted July 11 Solution Posted July 11 @Karen_Ruby Hi! You can update your existing code to the following and add the code in Website > Pages > Website Tools > Custom CSS /* Homepage -> Portfolio page -> Commissions page */ #collection-652e9b358e9ce27847c2f9cd .gallery-grid-wrapper, #collection-65361f360f0e9c0655e62712 .gallery-grid-wrapper, #collection-653828f9dedc8d69cd9dec62 .gallery-grid-wrapper { display: grid; grid-template-columns: repeat(4, 1fr) !important; } @media screen and (max-width: 767px) { #collection-652e9b358e9ce27847c2f9cd .gallery-grid-wrapper, #collection-65361f360f0e9c0655e62712 .gallery-grid-wrapper, #collection-653828f9dedc8d69cd9dec62 .gallery-grid-wrapper { grid-template-columns: repeat(2, 1fr) !important; } } tuanphan 1 If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. Sam Web Developer & Digital Designer ☕ Did you find my contribution helpful? Buy me a coffee?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment