What could be causing the overflow scrolling feature to fail on larger screens?

I'm currently working on a Vue project and I've included the following HTML:

 <div class="flex flex-col md:flex-row">
  <div class="m-6 ml-10 mr-5 mt-10">
    <div class="text-left">
      <input type="text" class="mb-6 h-10 w-full rounded-lg border-2 border-gray-300 p-2" placeholder="Search for workouts, profiles, etc." />
    </div>
    <div class=" ">
      <div class="mb-3 text-left">
        <p>Discovering new workouts</p>
      </div>
      <div class="flex h-28 flex-row gap-3 overflow-x-auto whitespace-nowrap">
        <div class="box inline-flex min-w-52 bg-black"></div>
        <div class="box inline-block min-w-52 bg-black"></div>
        <div class="box min-w-52 bg-black"></div>
        <div class="box min-w-52 bg-black"></div>
        <div class="box min-w-52 bg-black"></div>
        <div class="box min-w-52 bg-black"></div>
        <div class="box mb-5 min-w-52 bg-black"></div>
      </div>
    </div>
    
  </div>
</div>

I am utilizing tailwind CSS in this scenario. A challenge I am facing is that the overflow-x-auto property doesn't seem to function correctly on larger screen sizes but functions properly when the screen size is minimized. On bigger screens, it scrolls into white space instead of staying within its container. Below are screenshots depicting how it appears on different screen sizes:

On a large screen: https://i.sstatic.net/Wi2EkREw.png

On a small screen: https://i.sstatic.net/TpGBMvFJ.png

Answer №1

Make the switch in your code:

<div class="grid grid-cols-2 sm:grid-cols-4 md:grid-cols-6">

Replace it with this:

<div class="grid grid-cols-2 sm:grid-cols-4">

Everything appears to be functioning correctly now. https://play.tailwindcss.com

Answer №2

In order to resolve the problem, you can simply apply a width to the outer div containing all the content. By setting it to 80%, the issue was successfully resolved.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How can JavaScript be used to dynamically display submitted HTML form values on the same page, as well as how to perform calculations on the form data?

Currently, I am working on creating a form for collecting passenger information at an airport. The form includes fields for first name, last name, passenger weight, and cargo weight. Upon submitting the form, I aim to display the entered information along ...

Struggling to display the sorted array items on the screen?

Within the realm of my jsfiddle experiment, my aim is to organize items based on price from highest to lowest by utilizing the following function: function mySortingFunction() { var elements = [].slice.call(document.getElementsByClassName("price")); e ...

The width of the container is exceeded by the drop-down menu during hover

My responsive drop-down menu is causing issues when the media query activates and I hover over the links, causing the width of the drop-down menu to extend beyond the container. <!-- Navigation Menu --> <div class="container"> ...

Generate a .py file through an HTML button click and save it to your device

My current project involves developing HTML and JavaScript code for a chatbot. I need to implement a feature where, upon receiving a Python program from the chatbot, a download button should be displayed. When users click on this Download button, they shou ...

Utilizing Jquery for deleting text content from a div element

I have a situation where I need to eliminate the text "(2012)" from a particular div using jQuery. Here is the code snippet that I am currently using: var el = $("#myDiv"); //replace(/word to remove/ig, ""); el.html(el.html().replace(/(2012)/ig, "")); ...

When two unique Ids are merged to modify the same div button in distinct ways

Hey there, I'm having a little issue with getting the password_photo_galleries to appear in the right place on my website. The only solution I've found is to add an extra button to the navbar to access that information. Ideally, I want the MyGall ...

Designing websites or applications for mobile devices requires careful consideration of how content will

Currently, I am trying to use media queries to cater to mobile screens. The main problem I am encountering involves the text on the header when switching between Portrait and Landscape modes. In the landscape view, the top property overrides the portrait ...

The primary tab's background color in a Shiny app

I had this question deleted previously while I was in the process of refining it. Is there a way to customize the background color of the active tab in a Shiny app? library(shiny) ui <- fluidPage( tags$head( tags$style(HTML(css)) ), tabsetP ...

Clicking on the icon reveals the current date

I need some help with the input field that displays the calendar date. Currently, I can only click on the input field to show the calendar date. What I actually want is for users to be able to click on a calendar icon to display the calendar date, which sh ...

What is the best way to use res.send() to target a specific ID within an HTML tag in Node.js?

In my search.html file, I have the following form: <form class="myform" action="/classi" autocomplete="on"> <input type="text" name="search" > <button type="submit" ></button> Upon pressing the button, the following code in ind ...

How can I convert the stylesheet link from fonts.google.com into a CSS class and include it in my file.css as an internal style instead of an external one?

Looking to incorporate a font from fonts.google.com? Here's how you can do it: <link rel="preconnect" href="https://fonts.gstatic.com"> <link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@200;300 ...

Reduce the size of the profile picture in the Facebook like box

I have a Facebook like box on my site but in some resolutions the profile pictures goes to next line after 2 pictures instead of 3 so I want to make the profile pictures width and height 49 instead of 50 because that would fix the problem. Here's how ...

Is there a way for me to determine the specific link that I have clicked on

I am implementing a table where users can edit the columns. Each cell contains an <a> tag that triggers a modal to change the value in the database and refresh the page. The issue I'm facing is that once the modal appears, the code doesn't ...

Adjusting the styles of dual navigation bars in the Adelle theme

I encountered an issue where my second navigation menu (nav2) is adopting the appearance of the first menu (nav1), and I'm having trouble resolving it. However, the content of the second menu is different. Snippet from header.php: <nav class="na ...

Tips for aligning the title to the left of text within a Bootstrap 4 card component

I have a situation where I need to adjust the layout of a card item in Bootstrap 4. Specifically, I want to move the title to the left of the text for screens that are not mobile. Is there a way to achieve this? Thank you! <div class="card flex-row fle ...

Why is the background of the wrapper not changing when I try to update it?

I'm having an issue with changing the background of my wrapper in a responsive WordPress theme. When I try to change the background, it doesn't update, but when I change the border, it does. I want my wrapper content to have a transparent backgro ...

Issue: Module 'tailwindcss' unable to be located (Next.js project)

After updating my Node Package Manager following the steps mentioned in this post, I encountered an issue. Whenever I create a new Next.js app and try to run it with npm run dev, I receive the error message below: error - ./node_modules/next/dist/build/web ...

Baffled by the intricacies of jQuery

As a newcomer to jQuery, I stumbled upon this code snippet and am curious about its function. It seems like it is replacing an element with the id reveal to a link with the class html5lightbox and id reveal. However, the part that puzzles me is $( '#r ...

Using PHP's include/require method with a dynamic path

Looking for assistance with my issue! Ajax is returning the correct information and displaying it in an 'alert(html)' on 'success'. The PHP code echoes $idName and $path correctly on the carrier page where the code resides. There are no ...

Filtering with checkboxes (looking for help with logic functionality)

Yesterday, I sought assistance with a similar question and was able to make progress based on the response provided. However, I have encountered another issue that has left me stuck. Current behavior: Clicking on a checkbox changes the background color of ...