Attempting to eliminate the right margin of a CSS grid

After creating a div and applying the "display: grid" property to it, everything seemed fine at first. However, I encountered an issue with a margin that appeared. I'm not sure if this is due to incorrect code on my part or some other reason. I attempted to use "margin: 0 auto;" but it actually made things worse! I also double-checked for any margins or paddings on the container element. See the problem here

$('#owl-carousel').owlCarousel({
                loop: true,
                margin: 30,
                dots: true,
                nav: false,
                rtl: true,
                items: 2,
            })
.text {
                    text-align: center;
                    height: 100px;
                    background: #0b0a0d;
                    color: #FFF;
                }

                .text .logo a {
                    margin: 0;
                    line-height: 100px;
                    font-size: 48px;
                    font-family: 'Zen Dots', cursive;
                }

                .nav {
                    background: #0c70de;
                    color: #FFF;
                    display: flex;
                    z-index: 9999;
                }

                .text .logo a {
                    color: #FFF;
                    text-decoration: none;
                }

                .nav ul {
                    margin: 0 auto;
                    padding: 0;
                    display: flex;
                }

                ul li {
                    padding: 20px;
                    list-style: none;
                }

                ul li a {
                    color: #FFF;
                    display: block;
                    text-decoration: none;
                    text-transform: uppercase;
                    font-family: 'Changa', sans-serif;
                }

                .sticky {
                    position: fixed;
                    top: 0;
                    left: 0;
                    width: 100%;
                }

                .contain {
                    margin: 0 auto;
                    max-width: 1200px;
                    width: 100%;
                    margin-top: 50px;
                }

                .item {
                    align-items: center;
                    display: flex;
                    height: 300px;
                    justify-content: cent...
            

Answer №1

To customize the grid ul, you must override the default settings

I introduced ul {padding-inline-start: 0px;} which resolved the issue

$('#owl-carousel').owlCarousel({
    loop: true,
    margin: 30,
    dots: true,
    nav: false,
    rtl: true,
    items: 2,
})
ul {padding-inline-start: 0px;}

.text {
    text-align: center;
    height: 100px;
    background: #0b0a0d;
    color: #FFF;
}
/* Other CSS styles omitted for brevity */
.anime-list ul li {
    padding: 5rem 1rem;
    text-align: center;
    font-size: 1.2rem;
    background-size: cover;
    background-position: center;
}
.anime-list {
    align-items: center;
}
<!DOCTYPE html>

<html dir="rtl">
<head>
    /* HTML and head content */
         <!-- * Header START -->

        /* Remaining body content */

&<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.js"></script>
<script src="script.js" async defer></script>
</body>
</html>

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

Controlling opacity with jQuery animate() function using a click event

I have a specific requirement for an animation. When the button is clicked, I need the element to transition from 0 opacity to full 1 opacity within 300 milliseconds. The issue I am facing is that when the button is clicked, the animation does not work a ...

Encountering issue with Django locating static file (1.5) showing ERROR 404 code 1649

I'm facing some difficulties in setting up my local Django site. I've reviewed the previous questions and answers, but haven't been able to find a solution. [20/Oct/2013 03:56:33] "GET /rides/ HTTP/1.1" 200 230 [20/Oct/2013 03:56:33] "GET / ...

Guide on dynamically changing the color of polymer 1.0 paper-button from an array of colors

I have an array called buttonColors that contains a set of colors in hex format. I am looking to create paper-buttons, each with the color from the buttonColors array. How can I achieve this in Polymer 1.0? <template is="dom-repeat" items="{{buttonCo ...

Change the CSS menu item to directly load the website instead of using javascript to replace a placeholder

I have a CSS navigation menu, but I'm facing an issue. When I click on a link in the menu, like Google for example, it only changes the name of the placeholder and doesn't actually load the page. Any suggestions on how to fix this? Thank you for ...

What is the best way to include two class names within a single div using Next.js?

Struggling to include two different CSS classes into a single div element, I encountered some issues. For reference, here is a screenshot: https://i.stack.imgur.com/UuCBV.png https://i.stack.imgur.com/sHNwq.png My code snippet looks like this: blog.js ...

The canvas div wrapper flexbox item is in need of scrollbars

I am looking to display a canvas that may be larger than the viewport size. The layout structure will include navigation on the left and controls on the right, with the canvas positioned in between them. When the canvas is too large for the screen, I wan ...

Is there a way to adjust the transparency of the reflection while utilizing the -webkit-box-reflect property?

Exploring the capabilities of the -webkit-box-reflect property in Chrome has proven to be quite interesting. By utilizing the code snippet provided below (taken directly from the Webkit blog), I have been able to achieve a fading reflection effect: -webki ...

Tips for adjusting the size of icons in Ionic Framework v4 and Angular 7

The library ngx-skycons offers a variety of icons for use in projects. If you're interested, check out the demo here. I'm currently incorporating this icon library into an Ionic project that utilizes Angular. While the icons work perfectly, I&ap ...

Is the container in semantic ui being breached by a segment overflow?

I've recently started learning Semantic UI. One issue I'm facing is that the width of the "segment" overflows the "container." Check this JSFiddle for more clarity. Are there any alternative solutions? In addition to the grid system, I'm ...

Ways to time animations differently and activate two animations at the same time in every loop

I have 3 hidden text boxes that I want to fade in and slide down simultaneously by 40px when the DOM loads. They should be staggered so that each one triggers after the previous animation finishes. Below is the relevant JavaScript code snippet: jQuery(fu ...

Is it better to use one large CSS file for Angular 2 or opt for separate files per component

When working with Angular 2, the choice of how to style your application is an important decision. Should you create one large minified .css file using a task runner like Gulp, or use Angular 2's styleUrls: ['myfile.css'] for each component? ...

Highlighting text in React using hover effects on list elements

Imagine having HTML / JSX structured like this: <ul> <li>First point in list</li> <li>Second point in list</li> </ul> and the goal is to highlight a contiguous range that spans multiple list items: <ul> < ...

Latest Chrome Update Resolves Fixed Positioning Bug

I am currently facing an issue with setting the second background image in the "Great people providing great service" section to a fixed position. You can view the website here: While the fixed position works in Safari and Firefox, it used to work in Chro ...

Modify the div height to match the parent div's height

I'm currently working on customizing a navigation panel, and I'm looking to align the styles of the various options with the parent div. One specific adjustment I need to make is setting the background color of the options to match the parent div ...

The Table and Div elements do not have identical widths when set to 100%

I am facing an issue with a Div and Table placed inside a container. Although they are meant to completely fill the container, occasionally there is a one pixel difference which can be quite annoying. I have prepared a test case and attached a screenshot h ...

Switching the navigation menu using jQuery

I am looking to create a mobile menu that opens a list of options with a toggle feature. I want the menu list to appear when the toggle is clicked, and I also want to disable scrolling for the body. When the toggle menu is clicked again, the list should c ...

Incorrect Calculation of CSS Grid Container Width in Firefox

When using this CSS Grid code, there is a difference in behavior between Chrome and IE compared to Firefox. https://codepen.io/inkOrange/pen/XGzeMo This layout is intended to scroll horizontally when the content overflows beyond the fixed container size o ...

Adjust the text to fit neatly within a circular-shaped column container

I am currently working with Bootstrap 5 and I have a row with two columns positioned next to each other. My goal is to apply rounded borders to the left column while ensuring that the content remains within the div. Below is the code snippet: <div clas ...

Graphic selectors: a new take on radio buttons

I've been attempting to make this work, but it's not functioning correctly. Below is the CSS code: .input_hidden { position: absolute; left: -9999px; } .selected { background-color: #000000; } #carte label { display: inline-bl ...

Looking to adjust the alignment in BootsFaces? Want to move the final link of the navbar to the right corner?

<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.c ...