Child container scrollbar covered by box-shadow

Currently, I am developing a page where on mobile devices, the navigation links need to be displayed horizontally and hidden via overflow if they are collectively too wide. To indicate to users that there are additional items to scroll through, I have added a white box-shadow with opacity that will slightly blur the covered links. This shadow is currently placed in a container next to the BUY NOW button.

If you'd like to see the current behavior, please visit this link.

LESS

.sticky-nav-menu {
  display: -webkit-flex;
  display: flex;
  align-items: center;
  width: auto;
  height: 100%;
  margin: 0;

  li {
    display: inline-block;
    white-space: nowrap;
    padding-right: 25px;
    margin-right: 0;

    &.active a {
      color: fade(@jet-dark, 80);
    }

    &:last-of-type {
      margin-right: 0;
    }
  }
}

.sticky-nav-overflow {
  height: 100%;
  margin-right: 4%;
  overflow: scroll;
}

.sticky-nav-mobile {
  padding-left: 2%;
  z-index: 1;
  box-shadow: -10px 0 5px 13px rgba(255, 255, 255, 1);
}

HTML

<nav class="sticky-nav js-sticky-nav clearfix">
  <div class="sticky-nav-inner">
    <div class="sticky-nav-overflow">
      <ul class="sticky-nav-menu">
        <li class="active">
          <a href="#lorem" class="sticky-nav-link">THE LOREM</a>
        </li>
        <li>
          <a href="#lorem" class="sticky-nav-link">THE IPSUM</a>
        </li>
        <li>
          <a href="#lorem" class="sticky-nav-link">THE CAESAR SALAD</a>
        </li>
        <li>
          <a href="#lorem" class="sticky-nav-link">THE RIO GRANDE</a>
        </li>
      </ul>
    </div>
    <div class="sticky-nav-mobile">
      <a href="#" class="sticky-nav-cta">BUY NOW</a>
    </div>
  </div>
</nav>

When the screen size is reduced to 400px or below (mostly observed on Firefox with devtools), scrolling all the way to the right results in the scrollbar being hidden by the box-shadow, which is not visually appealing. I'm seeking suggestions on how to resolve this issue within the existing structure, or any alternative approaches for better outcomes.

I appreciate all responses and thank you for your assistance!

Answer №1

The issue seems to be with the box shadow blocking the scroll on screens that are smaller than 400px in width. To address this, you can simply adjust the margin-right value from 4% to 8%, or any other suitable value.

.sticky-nav-overflow { margin-right: 8%; }

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

Is there a way to ensure that when displaying information boxes with Bootstrap, the inputs do not get misplaced or shuffled to the wrong location

I have been working on a form that needs to display an alert: https://i.sstatic.net/uGKtG.png When clicking the button next to the input control, an alert should appear. Although the alert is showing correctly, the input controls are shifting to the wron ...

Using C# to block specific sections of HTML code

Suppose I need to prevent a specific HTML code from running on a website using WebBrowserControl1. I attempted approaches like WebClient1.DownloadFile("website.html", @"C:\BlockerWork"), File.ReadAllText(@"C:\BlockerWork"), String.Replace, follow ...

What is the proper syntax for using .focus() with the nextElementSibling method in typing?

As I strive to programmatically shift focus in my form using nextElementSibling, I encounter a challenge with typing variables/constants due to working with Typescript... I have managed to achieve success without typing by implementing the following: myF ...

Determine the time variance in hours and minutes by utilizing the keyup event in either javascript or jquery

There are 6 input fields, with 5 input boxes designated for time and the result expected to display in the 6th input box. See the HTML below: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input ty ...

Generating interactive buttons that delete a row in a data table

I am facing an issue with creating delete buttons for each row in my database. Despite the data being displayed correctly and the table functioning properly, when I click on the button to delete a row, it disappears temporarily but reappears upon reloadi ...

The Hover Effect on HTML Element Not Working on One Side Specifically

Scenario: Currently, I am working on creating a popover (tooltip) using Bootstrap 3.3.7. In order to achieve this, I have structured my HTML file as follows: popover { margin-left: 100%; padding: 5px 11px; border: solid 1px; border-radius: 25px ...

Height of the image is being boosted while the width remains consistent

When working on a responsive page layout, I encountered an issue with increasing the height of an image while keeping the width constant. Modifying the width of the image reflects changes, but adjusting the height does not seem to make any difference. I t ...

There is no index signature on type '{}' that accepts a parameter of type 'string'. Error code: ts(7053)

Just starting out with react typescript and I've encountered a problem with props and their types. Specifically, this line is causing an error: collapseStates["" + el.name + el.identifier] = true;. The error message reads: "Element implicitl ...

Avoiding duplicate clicks on image map regions

Looking for a solution to prevent the DoStuff() method from being executed twice in a double-click scenario on my basic image map. The current setup runs the routine whenever an area is clicked, but causes issues with double-clicking. Any suggestions on ...

Align title text to the right within the Material Design Card

I have implemented a Material Design (MDL) card to showcase numeric values in the title. However, I am facing an issue where the values are left aligned by default and I want them to be right aligned. Despite trying various styles, they are being ignored ...

When printing a table in HTML/CSS, only the header will appear on the empty page

I'm struggling to figure out why there are two pages, one blank and one with just the table header in this document. The content looks fine otherwise, but I can't seem to remove these extra pages. Here is the full HTML code: <!DOCTYPE html& ...

How can you determine the number of times a particular digit appears around a specific position in a TypeScript array

(Utilizing Typescript for assistance) I am looking to determine the number of occurrences of the digit 2 surrounding a specific position within an array. The function takes in the position coordinates as parameters - param 1 for row and param 2 for column. ...

Unexpected Placement of Bootstrap 4 Table Spinner in Chrome and Internet Explorer

I am struggling to create a dynamic spinner within a table's tbody using Bootstrap 4. Here is what I have attempted so far: HTML <div class="container mt-2"> <div class="card"> <div class="card-body"> <div class="row"> ...

DIV size issue resolved

Content within a div is surpassing the set fixed size determined by CSS. <style> #fixeddiv { position: fixed; margin: auto; max-height: 300px; max-width: 700px; } </style> <div id="fixeddiv"> <div id="M77 ...

Interpreting HTML with JavaScript

Currently, I am attempting to parse an HTML document. This is the given HTML snippet: <div> <a class="profilePicThumb" href="https://www.facebook.com/photo.php?fbid=669986173135523&amp;set=a.219741158160029.56045.100003724408511&amp; ...

A method for evaluating the condition of a <td> value in a table based on its corresponding table header

I am looking to modify the th and td values in my HTML code. Specifically, I want to align numbers to the right (except for s.no) and text to the left. <button type="submit" class="btn btn-raised btn-primary mr-5" (click)="productPrintSection(&apos ...

Choose various div elements and modify their background colors

I have a PHP loop where I am creating multiple divs dynamically. Here is the code snippet: <?php for ($i=0; $i<=9; $i++) { for ($j=0; $j<=9; $j++) { echo "<div class=\"bg\" id=\"aaa".$i."&bsol ...

hiding an "input type="file" element by using a button to conceal it

Is it possible to create a button that triggers file upload functionality? I couldn't find any solutions on Google. I've heard it can be done with labels, but I specifically need to use a button for better UX/UI. <button style="position:fixe ...

Instructions on incorporating svg into pug using a mixin

I've created a mixin mixin icon(url) svg() use(xlink:href=url) Below is the code to output - var features = [ { icon: +icon(img/time.svg) } ] each item in features +feature(item.icon) Can someone point out wher ...

Using JavaScript variables in CSS: a beginner's guide

My website features a typewriter effect, but I want the animation to match the length of the words exactly. I attempted using JavaScript variables in CSS, but unfortunately, it's not functioning properly. Could someone please advise me on how to remed ...