I have a specific responsive layout that I need to achieve using a series of div tags. Below is the HTML structure I have:
<div class="container">
<div>1</id>
<div>2</id>
<div>3</id>
<div>4</id>
<div>5</id>
<div>6</id>
<div>7</id>
<div>8</id>
<div>9</id>
</div>
For larger screens, it should display as 4 columns only, with columns 4-7 forming a mini grid within themselves and hiding columns 8 and above.
https://i.stack.imgur.com/sflf6.jpg
On smaller screens, the columns should simply be displayed in sequence without any special arrangement, which should be straightforward to implement and does not require assistance.
https://i.stack.imgur.com/2vDcX.jpg
I prefer to utilize a CSS grid system if possible, but am open to using flexbox if necessary. It's crucial that no nested divs are used unless they can easily be expanded via CSS to display appropriately on smaller screens as shown in the example images.
Is the above scenario achievable? My current attempts have been unsuccessful.