The right side is not visible on the screen when scrolling horizontally

When viewing my website on mobile, there is a horizontal scroll that displays three divs like cards. The horizontal scroll functions correctly, except for the last div whose right margin of 6px is not visible. All three divs have margin-left: 6px and margin-right: 6px;

Here's the left margin displaying correctly:

https://i.sstatic.net/L53hC.png

And here's the issue with the right margin not showing at all:

https://i.sstatic.net/3aXSb.png

@media only screen and (max-width: 480px) {
  /* Html */
  html {
    overflow: scroll;
    overflow-x: hidden;
  }
  /* Cards */
  .mobile-card-container>.row {
    overflow-x: auto;
  }
  .mobile-card-container {
    display: block;
  }
  
  .card-background {
    height: 100px;
    background-color: #ffffff;
    border-radius: 6px;
    margin-top: 16px;
    -webkit-box-shadow: 0px 2px 4px 1px rgba(0, 51, 102, 0.1);
    -moz-box-shadow: 0px 2px 4px 1px rgba(0, 51, 102, 0.1);
    box-shadow: 0px 2px 4px 1px rgba(0, 51, 102, 0.1);
    margin-left: 6px !important;
    margin-right: 6px !important;
  }
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">

<html>

<body>


  <!-- Simulaciones Default -->
  <div class="row">
    <!-- Mobile Card Container -->
    <div class="col-12 mobile-card-container container-fluid" style="border: 1px solid;">
      <div class="row flex-nowrap flex-sm-wrap" style="border: 1px solid red;">
        <!-- Card 1  -->
        <div class="col-10 card-background simulacion mx-auto">
          Card 1
        </div>

        <!-- Card 2 -->
        <div class="col-10 card-background simulacion mx-auto">
          Card 2
        </div>

        <!-- Card 3 -->
        <div class="col-10 card-background simulacion mx-auto">
          Card 3
        </div>

      </div>

    </div>
    <!-- /Mobile Card Container -->



</body>

</html>

Answer №1

By simply including a content in the final div, my issue was successfully resolved.

Resolving the collapsing of last margin/padding in flexbox/grid layout

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

Styling the alignment of category menu columns using CSS

I'm looking for advice on customizing a menu in Magento. The current menu is functional, but I'm not happy with how the items are aligned on the website. Below, you'll find an image of the current menu and another one displaying my preferred ...

PHP address in the image

I'm currently working on an app that extracts content from HTML pages, but I've run into a tricky issue: On a specific HTML page, there's an image displayed with a URL pointing to a PHP address. However, when I attempt to copy and open this ...

Launching a website in an external browser from an iPad phonegap app

Similar Question: phonegap: how to launch external links in Safari instead of the app's UIWebView Developed an HTML5 app for my iPad using PhoneGap. The app includes external links to web pages. However, when clicking on these links, they ope ...

What could be causing the lack of downward rotation of my arrow in css? (specifically, the span element)

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=de ...

Adjusting HTML5 drag height while resizing the window

Code conundrum: var dragHeight = window.innerHeight - parseInt(jQuery("#drag_area").css("margin-top")) - 5;. It sets the drag height based on browser size, but there's a glitch. If I start with a non-maximized browser and then maximize it, the drag he ...

Help with executing a function and assigning the output to a predefined location depending on the calling statement with the use of jquery

While not professionally trained in web development, I find myself immersed in jQuery as I craft a customized timesheet form for my employer's unique requirements. Specifically, my focus is on the part of the timesheet that involves inputting Start T ...

HTML parsing with HTMLAgilityPack can sometimes be tricky, as the SelectNodes

I've heard great things about the HTMLAgilityPack library and decided to give it a shot, but I have been struggling to make it work for months now. No matter what I do, all my attempts seem to result in null. Following tutorials like this one () doesn ...

Password confirmation on the login screen will be displayed in a single line

As someone who is relatively new to HTML/CSS, most of what I have learned has come from this platform or by searching for answers online. I am nearing completion of my assignment, but I am struggling to figure out how to display two label words on the same ...

Are divs within tables ignoring overflow settings?

I'm currently working on a calendar project that can be viewed at the following link: Each table cell in my calendar has a specified width of 14%. This maintains consistency across all columns, and it's crucial for me to keep this 14% intact. O ...

The comments section is not functioning correctly below the post on jsonplaceholder

Upon clicking the comment icon, I noticed that comments are only displayed on the first card and their appearance changes solely on the initial card. While everything else appears to be functioning correctly, I would like each card to individually display ...

Obtaining the checked checkboxes from an ASP CheckBoxList within an ASP Repeater is a common task

By default, the checkboxes on the page will always be unchecked when loaded. The user can then select their desired options and click save. The size of the checkbox list may vary. In order to compile a list of the checked checkboxes and pass them to a sav ...

Shift the sleek navigation arrows to the interior of the slides

Is there a way to relocate the navigation arrows on the slider images? I have tried various methods found online with no success. Currently using ASP.NET, but doubt it matters. Employing the latest version of SLICK. Here is the HTML code snippet: <%@ ...

Instructions on using $.post in jquery to sude uploaded file to a php file for processing

Is there a way to upload photos asynchronously using $.post without relying on .serializeArray()? I want to send a form, containing an upload file, to a PHP processing file. Any suggestions? HTML: <form action="upload1.php" method="post" id="usrform" ...

I am facing issues with the functionality of the Bootstrap 4.3.1 tab feature in my

After browsing their website, I almost replicated the code. The tab initialization works perfectly, and new panels activate when clicked on tabs. However, the "active" class doesn't get applied to the activated tab. Here is the code snippet: <ul c ...

Simultaneously transitioning two full-width elements by sliding them in and out

Currently, I am working on creating an animation effect where one element slides out of the screen on the left while fading out to 0 opacity. Simultaneously, a new element slides in from the right to take its place. Although the visual aspect is functioni ...

Acquiring multiple td elements within a table

Need help with selecting cells in a table implementation. Check out this efficient solution: var app = angular.module('plunker', []); app.controller('MainCtrl', function($scope) { $scope.ids = []; }); app.directive('dr ...

A technique for cycling through a menu, eliminating a class, and then applying a new class to the active menu option

In my navigation menu, I have a structure that helps in navigating through content slider panels. <div id="menu"> <ul> <li><a href="#1" class="cross-link highlight">Bliss Fine Foods</a></li> <li><a h ...

Utilizing an Entity's Location for triggering an Action in AFrame

Looking to create a custom component that can track the position of a sphere within an AFrame scene and trigger an event when it reaches a specific coordinate (for example, resetting to its default position as shown below): AFRAME.registerComponent("t ...

Adjust the transparency of the image when hovered over, but keep the text in the center

How can I change the opacity of an image on hover and simultaneously display text in the center of the image? This is my code: <div class="col-md-4 j-t"> <div class="middle"> <div class="text-middle">Play</div> < ...

Ways to prevent onMouseDown from triggering when the element is exclusively clicked?

I'm currently working on developing a game where units (svg elements) are controlled using React. In this game, the units should be draggable, and clicking on a unit should open a form. However, when I click on the unit, only the mousedown event is t ...