I am looking to only display 3 columns on my webpage and hide the rest of the content. I believe that adjusting the height of the container dynamically to fit just 3 columns may be the solution, but I am unsure how to achieve this or whether it is the correct approach. Any guidance on this matter would be greatly appreciated 🙏
Currently, I am utilizing scss for styling, however, I am open to examples in css as well.
.contentContainer {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
grid-gap: 5px;
place-items: center;
height: 330px; // I speculate this might need to be adjusted dynamically
overflow: hidden;
.imageContainer {
width: 100%;
height: 100%;
img {
width: 100%;
height: 100%;
aspect-ratio: 1/1;
border-radius: 5px;
}
}
}
Edit: I have no issues incorporating JavaScript if needed.