The stickiness of elements causes scrollbars to disappear in Chrome 77 on OSX

In this scenario, I have set up two tables where the first one has a sticky header achieved with

  position: sticky;
  top: 0px;

https://codepen.io/seunje/pen/JjjRVLm

The sticky header works perfectly fine, but there is an issue with scrollbars disappearing! This problem seems to occur only in Chrome.

Is there a workaround available for Chrome?

.container {
  height: 50px;
  overflow: auto;
}
.table {
  display: table;
  width: 100%;
}
.tr.sticky-header {
  position: sticky;
  top: 0px;
}
.td.sticky-header {
  position: sticky;
  top: 0px;
}
.tr {
  display: table-row;
}
.td {
  display: table-cell;
}
<div class="container">
  <div class="table">
    <div class="tr sticky-header">
      <div class="td sticky-header">H1</div>
      <div class="td sticky-header">H2</div>
      <div class="td sticky-header">H3</div>
      <div class="td sticky-header">H4</div>
      <div class="td sticky-header">H5</div>
    </div>
        <div class="tr">
      <div class="td">1</div>
      <div class="td">2</div>
      <div class="td">3</div>
      <div class="td">4</div>
      <div class="td">5</div>
    </div>
        <div class="tr">
      <div class="td">1</div>
      <div class="td">2</div>
      <div class="td">3</div>
      <div class="td">4</div>
      <div class="td">5</div>
    </div>
        <div class="tr">
      <div class="td">1</div>
      <div class="td">2</div>
      <div class="td">3</div>
      <div class="td">4</div>
      <div class="td">5</div>
    </div>
  </div>
</div>
<div class="container">
  <div class="table">
    <div class="tr header">
      <div class="td header">H1</div>
      <div class="td header">H2</div>
      <div class="td header">H3</div>
      <div class="td header">H4</div>
      <div class="td header">H5</div>
    </div>
        <div class="tr">
      <div class="td">1</div>
      <div class="td">2</div>
      <div class="td">3</div>
      <div class="td">4</div>
      <div class="td">5</div>
    </div>
        <div class="tr">
      <div class="td">1</div>
      <div class="td">2</div>
      <div class="td">3</div>
      <div class="td">4</div>
      <div class="td">5</div>
    </div>
        <div class="tr">
      <div class="td">1</div>
      <div class="td">2</div>
      <div class="td">3</div>
      <div class="td">4</div>
      <div class="td">5</div>
    </div>
  </div>
</div>

Answer №1

To keep the header noticeable at all times, consider adding a background color and increasing its z-index value.

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

Button for toggling the mobile navbar in Bootstrap

Is there a way to adjust the position of the navbar-toggle button http://prntscr.com/5sldgb within the navbar after changing its height? Here is the HTML code: <div class="navbar navbar-default"> <div class="container"> ...

Looking for assistance with a straightforward CSS opacity fix for Internet Explorer

Take a look at this page comparison between chrome and IE. On the right side, you'll notice drop down fields. While Chrome displays them correctly, IE shows rectangular boxes instead. To fix this issue, I added opacity to the select fields with the ...

"Trouble with 3D hexagonal grid in CSS - unable to achieve desired display

In order to create a dynamic Hexagonal Grid using CSS, the objective is to automatically reorganize hexes in a circular or rectangular manner when a new div with a specific class (e.g. 'hexes') is added to the view. Currently, there is a grid wi ...

Tips for adjusting image and div sizes dynamically according to the window size

In my quest, the end goal is to craft a simplistic gallery that closely resembles this particular example: EXAMPLE: This sample gallery is created using Flash technology, but I aim to develop mine utilizing HTML, CSS & Javascript to ensure compatibil ...

Python web scraper unable to locate specified Xpath

My question was previously posted here: Xpath pulling number in table but nothing after next span In testing, I successfully located the desired number using an XPath checker plugin in Firefox. The extracted results are displayed below. Although the XPa ...

Having trouble with sending a post request through ajax

Whenever I try to initiate an Ajax request upon clicking a button, the request never seems to get executed. Below is the snippet of my HTML code : <!DOCTYPE html> <html lang="en"> <head> <title>User Form</title> ...

Custom view with spannable text functionality

Can a custom view be included in a spannable text? I've noticed various types of spannable objects in the android.text.style package, but I'm curious if it's possible to insert a custom view. Something like spanable.setSpan(CustomView, .. ...

HighCharts.js - Customizing Label Colors Dynamically

Can the label color change along with gauge color changes? You can view my js fiddle here to see the current setup and the desired requirement: http://jsfiddle.net/e76o9otk/735/ dataLabels: { format: '<div style="margin-top: -15.5px; ...

Cross-domain scripting with JavaScript

I currently manage 2 subdomains securityservices.example.com workstations.example.com All workstations are associated with the workstations.example.com One of the workstations, known as WS789012 on the domain, is fully qualified as: WS789012.workst ...

Unable to adjust font weight as intended

I'm encountering an issue with getting the lighter font weights to display correctly. Despite having all the necessary font weights installed on my computer, it seems that many fonts do not support the lighter options. What could be causing this incon ...

Styling radio buttons with customized CSS borders

I'm attempting to style some radio buttons with a bold red border, but I'm having trouble getting it to display correctly in the latest versions of Firefox and Chrome. It works fine in IE9/IE8. For each input element that is required on my form, ...

Please tap to dial: Access to navigation is restricted

Trying to add a click-to-call link with the following code: <a href="tel:+4912345678912">Tel: +4912345678912</a> Despite Google developers saying it should work, major mobile browsers are blocking the navigation when clicking on the link. It ...

Creating a curved edge for a shape in React Native can add a stylish and

Issue Description I am working on an app and struggling with styling the bottom navigation bar. It's more complex than what I've done before, especially the curved top edge of the white section and the area between the blue/green circle and the ...

Ways to create a fading effect for a div container

As I delve into learning Rails, I've been immersed in a Rails web app where there is an enticing "Order" button that triggers a response saying: "Thank you for ordering". This message is displayed using the flash action. To enhance user experience, my ...

What are some creative ways to animate a highlight effect on a CSS

I'm struggling to implement a sliding underline effect for my top navigation bar on hover. I've tried using transitions and keyframes, but so far it's not working as expected. My current attempt only triggers the effect on the parent elemen ...

Hover-activated dropdown menu

After reading numerous tutorials and spending hours trying to create a submenu on hover, I still can't seem to get it to work. My goal is to display "Zimmer", "Reservierung", and "Preise" in a vertical menu when hovering over "Hotel," and so on. Here ...

Can JavaScript be utilized to dynamically adjust the size of all elements on the screen to a specified percentage of their initial height and width when a certain event occurs?

I'm fairly new to the world of JavaScript, but I have a basic understanding of it. I want to optimize my personal website for mobile devices. I've already taken care of screen orientation and element positioning, everything is centered nicely and ...

Adjusting the thickness of the CSS cursor line upon entering an input field

Having an image as the background for an input field has been causing issues for me. Although I can adjust the line-height and font-size easily, the cursor line appears outside of the background image when clicking inside the input field. Is there a speci ...

Issue with relative input causing Jquery click event to not fire

Jquery $(document).on("click","[type=text]",function(event) { alert('test'); }); CSS .noWorking:focus{ z-index:100; position:relative; outline:none; box-shadow:0 0 0 1000px rgba(0,0,0,.2); } To ensure the shadow appears on top of all oth ...

Issue with rendering images on Bootstrap-Vue card component

In the process of creating a static website with Vue.js, I am attempting to incorporate a basic Bootstrap card using Bootstrap-Vue. Unfortunately, I am facing an issue where the image does not display when utilizing the b-card component with the img attrib ...