davidpascott Posted November 2, 2021 Share 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 Link to comment
KwameAndCo Posted November 2, 2021 Share 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? tuanphan 1 If my answers have helped you, please drop a like and mark my answer as best to help other users find solutions quickly. Some links may be affiliate/referral links. You can also thank me by buying me a coffee ☕. Squarespace Tips & Tricks: @squareskills (Youtube 📺 Tutorials - Resource site coming soon) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment