Issue with overflow-x in Chrome browser on mobile devices

I'm currently working on a css parallax website. Everything looks great on desktop, but when viewed on mobile devices, I encounter a horizontal scrollbar issue due to the transform3d scale (even with overflow-x:hidden applied to the parallax class). If I switch to overflow:hidden, the issue is resolved but then I lose the ability to scroll through the content.

$parallax-perspective : 1 !default;

.parallax{
  height: 100vh;
  width: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
  @include perspective($parallax-perspective*1px);
  @include transform-style(preserve-3d);
}

.parallax__group {
  position: relative;
  height: 100vh;
  @include transform-style(preserve-3d);
}

@mixin parallax__layer(
$distance    : 0,
$perspective : $parallax-perspective
) {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  @include transform3d(
      translate3d(0,0,$distance * $perspective * 1px)
      scale(abs($distance - 1), abs($distance - 1)));
  z-index: $distance * 1000;
}

.parallax__layer--base {
  @include parallax__layer(0);
}
.parallax__layer--back {
  @include parallax__layer(-1);
}


<div class="parallax">
  <div class="parallax__group">
    <div class="parallax__layer--base"></div>
    <div class="parallax__layer--back"></div>
  </div>
</div>

Answer №1

This code snippet is utilizing a wrapper class

.parallax__inner{
  overflow-x:hidden;
}

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

Adjust the vertical size of a table cell

I am currently working on code that was written by someone else and I am facing an issue with a 3 block element that needs to be modified. My goal is to change the height of the first block so that it only goes as big as the image inside it. Despite my e ...

Formatting of large numerical values with jQuery

I have a huge table with numbers and other data. I want to color the large numbers based on their value in decimal, hundreds, thousands, and millions. For example: <tr> <td class="numColour">20,000,365.00 ISK</td> <td class="nu ...

The items are misaligned in a horizontal position

The 4 divs are styled with a width of 23% and displayed using inline-block. They have a fixed height of 220px and no margin applied. However, the issue arises as they are not aligning horizontally Despite attempting to adjust the height and width paramete ...

Unable to apply 100% height to flex child element

When it comes to creating a layout for my website, I have a simple idea in mind. I want the body content to take up at least 100% of the height of the page. This setup works perfectly on desktop screens, but when I switch to a mobile view (which changes th ...

Issue with CSS on various mobile devices

Using this CSS to display a fixed part at the bottom of the mobile screen, I noticed that it works well on the Samsung Grand Prime but appears narrower on the Samsung J7 Max. Here is the code snippet and images for reference: .footer { position: fixed ...

Enhance the appearance of the initial row in the v-data-table component within vuetify

I have utilized the Vuetify data table component to define the table shown below. My current challenge involves figuring out how to make the first row of the table appear in bold. Specifically, I want the text of the first item record to be bold. Any ass ...

Display picture next to content with the help of CSS/Bootstrap and Django's Jinja 2

I'm having trouble displaying an image next to text, it keeps showing up below. Here's the code snippet: <div class="container"> <div class="row"> <div class="col-md-8"> < ...

Expand the width of the drop-down menu items

Having trouble with my submenu dropdown menu... I want to increase the width of my submenu without affecting the main menu, but they seem to be interconnected and I need them to function independently. .fancyNav{ /* Styles for the UL element */ ...

Animate a box moving continuously from the right to the left using jQuery

I'm trying to create a continuous motion where a box moves right, then left, and repeats the cycle. However, I can only get it to complete one cycle. $(document).ready(function() { function moveBox() { $('#foo').css({ 'ri ...

Margins Disrupt Proper Text Alignment;

(If you know of a simpler solution to this issue, please share!) I am aiming for this website to consist of two text sections, one on each side of the screen. I managed to achieve this successfully by using text alignment and translate3d to shift the tex ...

What is the process for embedding HTML and CSS content into an Outlook email?

Has anyone experienced trouble adding an HTML and CSS web page to an Outlook email? I attempted to use the "Insert as text" option, but the CSS file is not loading correctly in Outlook. Any suggestions on how to fix this? The error message states that the ...

I am having trouble with the spacing on my website, even after I have tried declaring it

I'm having trouble formatting the footer to appear at the bottom of the page. I've tried adjusting the CSS code for the .container and .footer classes, but nothing seems to work. As a newbie in website development, any helpful tips or suggestions ...

Conceal information within a label

I am encountering an issue with a wordpress plugin and I am attempting to conceal (or alternatively, replace which would be fantastic) the terms "DD", "MM" and "YYYY" in the provided code: <div class="smFormInlineFormCont"> <div class="smInli ...

Tips for managing a date picker with JavaScript using the Selenium WebDriver

I have been attempting to scrape a travel website using Selenium Webdriver and Python. While I have successfully set the destination (destino) and place of origin (origem), I am encountering difficulties when trying to select a date. I understand that Ja ...

Instructions for applying a border style to a dynamically generated table using jQuery

I'm currently working on adding CSS to a table that is generated dynamically when a button is clicked. The function that is triggered on the click event includes the following jQuery code to create the dynamic rows: $("#employeDetail").append('& ...

Using Javascript or jQuery to Enhance the Appearance of Text on a Website

Is there a way to automatically apply styling to specific phrases on our website by searching for instances of those phrases? For example: <div> This is what you get from <span class="comp">Company Name</span>. We do all kin ...

Highlighting the active nav-item in Bootstrap-5 is proving to be a challenge

I'm having trouble with the Bootstrap navbar. I want to change the color of the active nav-link, but it's not working as expected. I am currently using Bootstrap-5. Below is the CSS code I have: .nav-link { color: #666777; font-weight: 4 ...

The orientation of the rating stars has transformed into a vertical layout

I'm having trouble creating a rating interface that prompts the user to rate the website (by clicking the stars) and leave a comment. The stars are displaying vertically instead of horizontally, as shown in the image provided in the link. I've tr ...

Displaying only the radio button without any additional elements, the Ionic 2 radio button (<ion-radio>) offers a

Looking for some guidance on implementing a list with radio buttons using the ion-list and ion-radio directives. The code provided should be clear, but please feel free to ask for more details if needed. I'm still new to Ionic and may be making some ...

Using a declared const in a separate React file

I've been searching for a solution, but haven't found anything that helps. I'm trying to retrieve data from an API and pass it to another page. The information is currently defined as "drink.strDrink", including the name and image. However ...