The scrolling feature in Tailwind CSS is malfunctioning

https://i.sstatic.net/RJ2ao.jpg

I noticed there is a scrollbar on the x-axis.

However, when I try to use the mouse wheel in that section, it doesn't seem to work...

If you have any insights, please assist me with resolving this issue.

Below is my code snippet:

<div className="flex space-x-3 overflow-scroll p-3 -ml-3">
            {cardsData?.map(({ img, title }) => (
              <MediumCard key={img} img={img} title={title} />
            ))}
          </div>

Here is the MediumCard component code:

const MediumCard = ({ img, title }) => {
  return (
    
    <div className="cursor-pointer transform transition hover:scale-105 duration-300 ease-out ">
      <div className="relative h-80 w-80">
        <Image src={img} layout="fill" className="rounded-xl" />
      </div>
      <h3 className="text-2xl mt-3">{title}</h3>
    </div>
  );
};

Answer №1

Kindly ensure to specify the width and height of this element

 <div className="w-[100vw] flex space-x-3 overflow-scroll p-3 -ml-3">
        {cardsData?.map(({ img, title }) => (
          <MediumCard key={img} img={img} title={title} />
        ))}
      </div>

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

Struggling to customize Vuetify styles with my own stylesheet

In my current project, I am utilizing Vue2 and Vuetify. One of the main challenges I am facing is that my Vuetify styles are always imported after my own custom styles. I attempted the following: App.vue <template> <v-flex> <v-c ...

extract the content of CSS pseudo-elements using Python or Selenium

Currently, I am working on automating a web service using Selenium and Python. My ultimate goal is to extract the text "test" located below. However, I am facing some challenges in figuring out if this is feasible through Selenium or any Python library. & ...

Developing a sliding menu with AngularJS

Currently, I am developing an AngularJS application. One of the features I am working on involves having a menu at the top of my page that, when an item is selected, will slide down to reveal content specific to that selection in the same area as the menu. ...

How to ensure your content is always visible on Mobile Safari iOS 8 by making sure it stays

Although minimal-ui is no longer supported on iOS8, I've encountered an issue with some fixed content at the bottom of a webpage. The page height is set to 100vh to cover the entire viewport, but some of the content at the bottom is extending below t ...

The CSS border-radius feature shapes the corners without affecting the background

When I apply a 15px rounded border to a div, the border appears rounded on the outside but the corners where the border meets the background remain square. Here is an example: http://jsfiddle.net/BQT5F/1/ I tried using the background-clip property to add ...

position the input and span elements side by side

Need help aligning an input and a span element next to each other. The span is currently positioned below the input, but I want it to be on the right side of the input. I am trying to create a search bar using this input and span tag, so they need to be al ...

Tips for manipulating the appearance of a parent element using CSS and VueJS

I'm currently working on a project where I need to loop through a set of users in order to create a table using the VueJS 'for' statement. One specific column is named "approved". If the value in this column is true, I want the entire row i ...

How come a child element with a lower z-index than its parent doesn't appear behind the parent?

I'm currently investigating why a child element fails to appear behind its parent element when it has a lower z-index value than the parent. The issue seems to arise only when the default z-index value of the parent is modified. Let's consider a ...

LESS keyframe mixing is a powerful feature that allows for easy

After extensive searching, I have yet to find a mixin that can create prefixed keyframes declarations without requiring messy fixes. In my quest, I have crafted the following mixin: .keyframes(@identifier, @animation) { .frames { content: ~"'&apo ...

Location of the html header navigation bar and main content area

Seeking assistance with HTML, CSS, and Bootstrap. I'm trying to create a template for my website that includes a top header, a side navigation bar, and a main section. However, I am struggling to position these elements correctly. The side navbar is a ...

What could be causing the excessive vertical spacing in an HTML list on Chrome: PHP output or CSS styling?

I'm having difficulty understanding why there is a significant vertical offset (around 170px) between one <li> element and the next. This issue seems to only occur in Chrome and not in Firefox, specifically within <li> elements when PHP co ...

The transparency feature is malfunctioning in IE9 when using a background

This is a demonstration of a lightbox feature. You can find the code here. When you click on the link "Show Panel," a form will pop out. It works correctly in Firefox but not in IE9. The HTML code is simple: <body> <a id="show-panel" href="#"&g ...

Tips for positioning an image at the center of a div element

How can I properly center an image in the middle of a div? <div class="main"> <img...> </div> In the code snippet below, the image is centered, but not perfectly in the middle. https://jsfiddle.net/web_garaux/tng7db0k/ ...

Applying and deleting CSS classes to the nth ancestor element

Is there a way to dynamically add and remove CSS classes to the parent of a specific element on a web page using a link button? Here is the code snippet: <div class="prod-box shadow"> <div class="prod-details"> < ...

Fixed navbar at the top changes from absolute positioning to relative when scrolling

My goal is to dynamically change the position of the navbar from fixed to absolute as the user scrolls past 600px. Initially, I used the following code: if (scroll >= 700) { $(".navbar-fixed-top").addClass("navbar-scroll"); } else { $(".navbar ...

Diverse browser behavior regarding HTML5 table cell padding

This situation can be simplified for better understanding. What I am observing is a discrepancy in appearance between Chrome 7.0 and Firefox 3.6.12. Interestingly, IE 9 beta seems to resemble Chrome. My goal is to apply padding to the TD element and have ...

What causes these images to stack on top of one another rather than align in rows? [HTML][CSS][Bootstrap]

I've implemented Bootstrap's grid system to showcase two rows, each containing two images. Here is the code: <section class="container"> <div class="row"> <figure class="column-sm-6"> <p>floor pl ...

Transforming Text On Hover Using CSS, as well as Customizing the Style

I've been struggling with this issue for quite some time now. Despite scouring the first page of Google search results for "css change text on hover," I have not been able to find a solution. Inside a div, I have text that is styled and positioned us ...

Can we leverage Angular service styles in scss?

I am working on a change-color.service.ts file that contains the following code snippet: public defaultStyles = { firstDesignBackgroundColor: '#a31329', firstDesignFontColor: '#ffffff', secondDesignBackgroundColor: '#d1 ...

Setting the maximum width for images across various Bootstrap responsive sizes: a step-by-step guide

I'm struggling with optimizing images of varying sizes in bootstrap to ensure they are responsive without losing quality. Current Image: https://i.sstatic.net/akoNy.jpg Desired Image: https://i.sstatic.net/37VFX.jpg HTML: <div class="row"> ...