What is causing my column's content to be lacking padding on the left side and having excessive padding on the right side?

Edit: Here's the link to the codepen https://codepen.io/maptik/pen/bGKMgpJ

In my React project, I'm utilizing Bootstrap to display cards for each "Product".

Here is a snippet of how I am rendering it:

<div className="container bg-color-tienda">
  <div className="center">
    {isLoading ? <h1>LOADING PRODUCTS</h1> : null}
    {!isLoading && products && products.length === 0 ? (
      <h5>No products available</h5>
    ) : null}
    {!isLoading && products && products.length > 0 ? (
      <div className="row">
        {products.map((product) => {
          return (
            <div className="col" key={product.id}>
              <div className="single-product">
                <div className="card">
                  {/* Thumbnail */}
                  <div className="product-thumb">
                    {product.published === false ? (
                      <div className="product-tag">Not Published</div>
                    ) : null}

                    <div className="image-box">
                      {product.imageUrl ? (
                        <img
                          src={product.imageUrl}
                          alt={product.name}
                          className="product-image"
                        />
                      ) : null}
                    </div>
                  </div>
                </div>
              </div>
            </div>
          );
        })}
      </div>
    ) : null}
  </div>
</div>;

However, my custom CSS seems to be affecting the column layout. The left padding appears to be missing, while the right padding has increased. This visual issue can be seen here: https://i.stack.imgur.com/t66Jq.png

Notice the lack of left padding and excessive right padding.

This inconsistency disappears when I remove this portion from my custom CSS:

.single-product {
  width: 350px;
  border-radius: 1rem;
  box-shadow: 0 5px 15px rgb(0 0 0 / 5%);
  margin-bottom: 30px;
}

After removal, the result looks like this: https://i.stack.imgur.com/1iovy.png

I would appreciate any assistance with this issue. Thank you!

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

Error: Property cannot be read after page refresh or modification

Upon refreshing or running the project for the first time, I encounter the error: TypeError: Cannot read property 'statements' of undefined This issue is perplexing as the data renders correctly but it appears that the connection is failing. ...

Caution: Exercise caution when utilizing a component sourced from a variable

Utilizing the AppBar component from http://www.material-ui.com/#/components/app-bar has presented some challenges. This is how my code appears: const Menuright = (props) => ( <IconMenu {...props} iconButtonElement={ ...

Create a dynamic onClick event script and integrate it into Google Optimize

I need to incorporate a button element into my website using Google Optimize for an experiment. This button needs to trigger a specific script depending on the variation of the experiment. I have attempted two different methods: <button id="my-button" ...

What steps can I take to address a 500 internal server error when attempting to execute a Python script within a CGI file?

Looking to execute a python script on a Strato-hosted website (.nl) using a CGI file. The setup includes my code: a cgi file, python file, and dependencies file for adding something to the PATH. Check out the files here. Here's what the folders look ...

Send form data using ajax technology

When testing my code on localhost, everything runs smoothly. However, when I tried running it on the server, it doesn't seem to be functioning properly. $("#MyUploadForm").ajaxSubmit(options); I would greatly appreciate any assistance with t ...

Why isn't my page appearing on the new react routing page?

I created a new page in my application that is supposed to be identical to other functioning ones, but for some reason, it's not displaying properly. The new page is quite simple: export function Test() { return ( <div> ...

Footer placement not aligning at the bottom using Bootstrap

I'm having trouble getting my footer to stay at the bottom of my website without it sticking when I scroll. I want it to only appear at the bottom as you scroll down the webpage. Currently, the footer is positioned beneath the content on the webpage. ...

Encountering a 500 Internal Server Error in Next.js immediately after invoking the useEffect Hook within a 404 Page

In my code, I utilize the useEffect hook to trigger a setTimeout function inside it in order to automatically redirect the user back to the home page after 3 seconds using the useRouter hook from Next.js and calling the push method on it. Everything works ...

The GatsbyJS Link component comes with a border that mimics the appearance of being selected by tapping the TAB key

My observation is that the UP and DOWN arrow keys are used to move the selection, indicating that it may be tabbed into somehow. https://i.stack.imgur.com/NsNjQ.png I came across a material-ui Menu component where Gatsby Link components were wrapping the ...

Creating a box that is connected by lines using JSON data requires several steps. You

I am attempting to dynamically draw a line using the provided JSON data. I have heard that this can be easily achieved with flexbox. Important: I would greatly appreciate a solution involving flexbox This is what I hope to achieve: https://i.stack.imgu ...

React component is being rendered, but it is not mounting properly, so it is unable

In my FillForm functional component, I am calling a list of objects to be rendered sequentially within the FormFiller function. The components are rendering correctly, but I encounter an error when trying to change their internal state. Warning: Can&apos ...

Is it possible to display a "click" message when a button is hovered over using CSS?

Whenever I hover over a button, I struggle to receive the appropriate message like "click" or "enter" before actually clicking it. How can I use CSS to style my buttons in a way that allows for this pre-click messaging? I have tried approaches such as .bu ...

Deploy the following page router to Azure: NEXT

I recently attempted to upload a NEXT project to Azure Web App, but encountered some issues during testing. Firstly, when I uploaded the NEXT (App Router) build files using both FileZilla and the VS Code Azure extension, I consistently received a 404 erro ...

I'm noticing that my variable is being updated with the new data after it has been saved to the file. Could this be a quirk of React

In the process of developing a note-taking application with React and NWJS, I have implemented a feature where notes are stored in a separate file named save.json. The app makes use of a useEffect hook to fetch initial data from this file, handles input ch ...

Automatically resizing images in a canvas when their resolution exceeds the canvas size in HTML5

I am currently using Html5, fabric.js, and JavaScript to upload multiple images to a canvas. However, there are instances where the uploaded image size exceeds that of the canvas. I am looking for a way to ensure that the image is set to a fixed size. v ...

Retrieving data from a child component that has been added in React

One of the challenges I am facing is dealing with a main react component that dynamically appends child components, like <Child />, on button click The structure of my Child component looks something like this: <form> <input .... /> ...

The SPLoaderError has encountered an issue while loading the component: Unable to load the specified component

While developing a SharePoint app in SPFX Framework, I encountered an issue. When compiling it with gulp build, everything works fine. However, when running gulp serve and adding the app to the workbench, the following error is displayed: [SPLoaderError ...

Using JavaScript, HTML, and CSS to select slices of a donut pie chart created with SVG

I have successfully implemented CSS hover effects and can manipulate the HTML to use the .active class. However, I am facing difficulties in making my pie slices switch to the active state upon click. Moreover, once this is resolved, I aim to enable select ...

How can I adjust the indentation in Angular Prime-ng's p-tree component?

In my project, I am utilizing the primg-ng tree component for the sidebar. Currently, the output is displayed as shown here: https://i.stack.imgur.com/kcSQt.png However, I am looking to maintain consistent indentation levels without any adaptive changes ...

In TypeScript and React, what is the appropriate type to retrieve the ID of a div when clicked?

I am facing an issue in finding the appropriate type for the onClick event that will help me retrieve the id of the clicked div. const getColor = (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => { const color = event.target.id; // ...