Using Tailwind CSS, I want to apply the scrolling effect when the content is too large to fit the screen width. I have a div container that holds the child elements, which I want to scroll. When I use a section to hold the image and the username (shown below), they all shrink to fit the screen size. This is not what I want. I want only a few sections to appear and the rest when I scroll. What am I missing?
Not working
<div class="flex overflow-x-auto space-x-8">
<section class="h-13 w-13 rounded-full border-2 border-purple-300">
<span><img src="download.jfif" class="h-13 w-13 rounded-full border-2 border-purple-300" alt=""></span>
<span>John</span>
</section>
<section class="h-13 w-13 rounded-full border-2 border-purple-300">
<span><img src="download.jfif" class="h-13 w-13 rounded-full border-2 border-purple-300" alt=""></span>
<span>John</span>
</section>
<section class="h-13 w-13 rounded-full border-2 border-purple-300">
<span><img src="download.jfif" class="h-13 w-13 rounded-full border-2 border-purple-300" alt=""></span>
<span>John</span>
</section>
</div>
If I put it like below, it's working, but I do not want it this way.
<div class="flex overflow-x-auto space-x-5">
<img src="download.jfif" class="h-10 w-10 rounded-full" alt="Bhutan">
<img src="download.jfif" class="h-10 w-10 rounded-full" alt="Bhutan">
<img src="download.jfif" class="h-10 w-10 rounded-full" alt="Bhutan">
<img src="download.jfif" class="h-10 w-10 rounded-full" alt="Bhutan">
<img src="download.jfif" class="h-10 w-10 rounded-full" alt="Bhutan">
<img src="download.jfif" class="h-10 w-10 rounded-full" alt="Bhutan">
<img src="download.jfif" class="h-10 w-10 rounded-full" alt="Bhutan">
</div>