Images displayed in the Slick carousel are automatically given a stylish padding

I'm facing an issue with my slick-carousel where there seems to be a large padding on the right side of the images, extending all the way up to the next product image. I've tried removing margins and paddings from my code but it hasn't resolved the problem. My goal is to have the images without any space in between so that I can add my own padding on both sides. Below is the HTML/Shopify Liquid code I am currently using:

{%- assign collection = collections[section.settings.collection]-%}
<div class="collection-title_wrapper">
    <h1>{{ collection.title }}</h1>
</div>

{%- if collection.description != blank -%}
<p>{{ collection.description }}</p>
{%- endif -%}

<div data-slick='{"slidesToShow": 3}' class="feature-grid-collection collection-slider">
    {% for product in collection.products %}
    <div class="grid-product">
        <div class="collection-slider-images">
            <a href="{{ product.url }}">
                <div class="collection-slider-image_wrapper">
                    <img src="{{ product.featured_image.src | img_url: '400x' }}"
                        alt="{{ product.featured_image.alt | escape }}">
                </div>
            </a>
        </div>
        {% unless product.available %}<br><strong>sold out</strong>{% endunless %}
    </div>
    {% endfor %}
</div>

{% schema %}
{
"name": "Product Collection",
"settings": [
{
"type": "collection",
"id": "collection",
"label": "Your Collection"
}
],
"presets": [
{
"name": "Product Slider",
"category": "Product Display"
}
]
}
{% endschema %}

Here is the CSS:

.collection-slider {
  .slick-track {
    display: flex;
    width: 100%;
  }
  .slick-prev {
    left: 0;
    z-index: 999;
  }
  .slick-next {
    right: 0;
    z-index: 999;
  }
  overflow: hidden;
  width: 100%;
  padding: 0;
  margin: 0;
  display: inline-block;
}

.grid-product {
  display: grid;
  justify-content: center;
  color: white;
  line-height: 1;
  border-radius: 5px;
}

Google Inspect screenshot: https://i.sstatic.net/ZCVGu.png

Website link: kuduzovic.myshopify.com, password: soltew. Feel free to check Google Inspect for yourself and see if you can identify the issue.

EDIT: Adding more details as some clarity may be required. The problem arises when adding slick to the section, causing random margin or padding only on the right side of the images. Clicking on this extra space behaves as if clicking on the actual image itself. For reference, here are images depicting the issue with and without slick added: -Without slick: https://i.sstatic.net/DFM3O.png -With slick: https://i.sstatic.net/x1NEC.png

Answer №1

Here's a solution that should resolve the problem of the image not being full width:

Consider adding this CSS code snippet:

.collection-slider-image_wrapper {
    margin: 10px; // customize as needed
}

.slick-slide img {
    display: block;
    width: 100%;
}

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

The input box fails to show larger values on the user's page

Show me the biggest number that the user enters in an input box and then display it back to them. I need some improvements to my code, ideally making it possible with just one input box instead of two. <!DOCTYPE html> <html la ...

Troubleshooting Problem with CSS and Javascript Dropdown Menu

Greetings, fellow web designers! I am relatively new to the world of web design and currently, I am immersed in the process of creating a website. My current project involves implementing a dropdown menu using CSS and Javascript. While I have made signific ...

Looking to add some movement to your website? Learn how to make an image track your mouse pointer in a specific section of your webpage

I'm just starting out with web design and javascript, so please be patient. My goal is to have an image follow the mouse pointer only when it's within a specific section of my website. I've managed to make the image track the mouse cursor ...

Html content overlapping div rather than being stacked vertically

My goal is to arrange a group of divs inside another div in a vertical stack. However, I am facing an issue where the text from the last div is overlapping with the second div instead of following a proper vertical alignment where the text in the third div ...

Eliminate border around image link

I can't figure out what I'm doing incorrectly... I included some CSS code a:active {text-decoration: none; border: 0px solid black} a:link {text-decoration: none; border: 0px solid black} a:visited {text-decoration: none; border: 0px solid black ...

Styling HTML elements with CSS to create a full width underline effect

Is there a way to make the underlines/borders full width for each line in a paragraph without adding line breaks? I'm seeking suggestions on how to achieve this. Two potential solutions I've considered are using the tag or creating an image, ...

The function within the React component is failing to produce the expected output

After importing two types of images (IMG and IMG2), I wanted to display IMG when the viewport width is less than 600px, and IMG2 when it's equal to or greater than 600px. I created a function to determine the viewport width and return the respective i ...

What is the best way to highlight titles that are unique but still prominent?

.test{ display:none; } .title:nth-child(odd){ background: #ddd; } <div class='title'>lorem</div> <div class='title'>lorem</div> <div class='title test'>lorem</div> <div class='tit ...

Type content in HTML5

Can you help me with a simple question? I am currently working on building my portfolio using html https://i.stack.imgur.com/rxYRS.png I want to be able to click on an image and add the description of my choice. Right now, it is showing something else: ...

Seamless changes with graceful fades while transitioning between classes

Is it more efficient to handle this in CSS than using jQuery? I'm not entirely sure. If anyone has a solution, that would be greatly appreciated. However, I am currently facing an issue with the jQuery method I have implemented. It successfully fades ...

Scrolling seamlessly within a container that is fixed in position

For hours, I've been attempting to incorporate smooth scrolling into my project with no success. The issue lies in the container where the anchor tags are located. If it's set to fixed position or absolute, none of my attempts seem to work. In ...

CSS disruptions occur during the deployment of Gatsby with MaterialUI components

I have a Gatsby site with MaterialUI Components, but I'm facing an issue with CSS styles being applied to the wrong components. The root of the problem seems to lie in the following code snippets: Layout.js <ThemeProvider theme={theme}> ...

Guide to modifying CSS properties of an individual element by manipulating class names with JavaScript

I have been searching for an answer to my question without success. I have a unique challenge where I need to change the styles of an h1 element by adding a class based on which radio button is clicked. The issue I'm facing is that when I select a dif ...

Having trouble locating the source of the issue causing the product page to appear too wide on Shopify

Can someone assist me in identifying the issue that is causing the product page on this website () to be too wide? Here is an image highlighting the issue. I made some CSS customizations to make the product gallery full width and added padding to the pro ...

The collapse menu toggle feature seems to be malfunctioning, as it is not functioning properly

I've been working on a website at , where the toggle menu is causing the content to hide when the menu is expanded. <aside id="layout-menu" class="layout-menu menu-vertical menu bg-menu-theme active"> <div class= ...

Connecting Documents and Organizing Folders

Currently, I am immersed in a web project leveraging java/ jsp/ servlets/ html/ css within Eclipse Tomcat. At the core of this project, all files are nestled neatly within the WebContent folder. Within my jsp files, I have encountered an issue when trying ...

Can my code be compacted to have 33% spacing with a margin between each division?

Arranging spacing evenly in CSS is a relatively straightforward process. Despite the abundance of stack overflow questions on the subject, one aspect that remains unclear is how to add spaces (or margin-left & margin-right) between each box. For clari ...

Unfortunately, the header and footer are not lining up correctly with the main body on our mobile site

I've been tasked with creating a fully responsive website, but I'm encountering difficulties with the mobile design. Specifically, when I switch to mobile dimensions like an iPhone 12, the header and footer don't line up properly with the ma ...

jQuery's show/hide functionality allows for the dynamic resizing of images,

I am experiencing an issue with a Joomla template that has a custom jQuery menu. When I hover over the map with my mouse, the overlay appears slightly larger than expected. This problem seems to be occurring in Firefox and IE 11, leading me to believe it ...

Issue with overflow-auto not displaying scroll bar

In my layout, I have a grid parent with two columns. The left child has a height equal to the parent (100vh), while the right child is 1000px tall, which exceeds the parent's height. Here is the HTML structure: <body> <div class="le ...