davidpascott Posted November 2, 2021 Posted November 2, 2021 Hi My site has an index page that features a page with two rows of four code blocks. Each code block shows an image that changes when the mouse is hovered over them. The reason for my enquiry is I am trying to figure out how to stop the code blocks from stacking as one long list in mobile. Is it possible to have them stacked as two columns of four images? Many thanks
KwameAndCo Posted November 2, 2021 Posted November 2, 2021 Put all of the code into one code block and use a wrapper set to "grid". Something like this: <div class=mywraper> <!--- Your codes go here --> </div> <style> .mywrapper { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; grid-gap: 20px; } @media (max-width: 768px) { .mywrapper { grid-template-columns: 1fr 1fr; } } </style> Alternatively, you could use flex-box? Work With Me 🖥️💻📱 Please remember to tag me so that I get a notification and respond to your help requests. If my answers have helped you, please drop a like and mark my answer as best to help other users find solutions quickly. You can also thank me or make requests by buying me a coffee ☕. (Caffeine fuels me to take more requests) For Squarespace Tips & Tricks, visit @squareskills (Youtube 📺 Tutorials) For Premium and FREE plugins, visit Squareskills (Plugin Store) 🧩 For Custom Plugins email me 🧩
Recommended Posts
Archived
This topic is now archived and is closed to further replies.