Concealing my menu with overflow-x: hidden on the body is not an option

Despite setting overflow-x: hidden on the body element, I'm still experiencing horizontal scrolling and can't seem to find a solution.

I've searched online for solutions without success. That's why I'm reaching out here in hopes of finding assistance. Thank you in advance!

Here are the provided HTML, SCSS, and JavaScript:

HTML:

<!-- HEADER -->

<div id="home" class="container-fluid home__hero">
    <nav class="menu">
        <div>
            <h4 class="logoMenu">Guinda Social Media</h4>
        </div>
        <ul class="nav-links">
            <li class="linkMenu liHome"><a href="#home" class="linkHome">Home</a></li>
            <li class="linkMenu liAbout"><a href="#about" class="linkAbout">About</a></li>
            <li class="linkMenu liTrabajos"><a href="#trabajos" class="linkTrabajos">Trabajos</a></li>
            <li class="linkMenu liContacto"><a href="#contacto" class="linkContacto">Contacto</a></li>
        </ul>
        <div class="contenedorBurger">
            <div class="burgerBtn">
                <div class="linea1"></div>
                <div class="linea2"></div>
                <div class="linea3"></div>
            </div>
        </div>
    </nav>

    <!-- FIN HEADER -->

    <!-- HERO -->

    <div class="row justify-content-center align-content-center">
        <div class="col-sm-12 col-md-12 col-lg-12 home__hero__col1" data-aos="fade-up" data-aos-duration="3000">
            <h1><span class="home__hero__h1--social">social</span><span
                    class="home__hero__h1--guinda flicker-2">guinda</span><span
                    class="home__hero__h1--media">media</span>
            </h1>
        </div>
        <div class="row">
            <div class="col-sm-12 col-md-12 col-lg-12 home__hero__col2">
                <section class="example example--2 bounce-top">
                    <span class="scroll-icon">
                        <span class="scroll-icon__dot"></span>
                    </span>
                </section>
            </div>
        </div>
    </div>
</div>

SCSS:

@import "variables.scss";

[SCSS content]

JS:

[JavaScript code]

Answer №1

To resolve your issue, consider replacing the overflow-x property with a display style value.

Here is an example using JavaScript:

document.getElementsByTagName("p").style.display = "none"

HTML can still show elements with overflow-x or visibility set to hidden.

To hide elements in HTML, simply include display:none within the style attribute (e.g. <p style ="display:none;")

Answer №2

Here's an instance regarding the body element: If there is any confusion, try replacing overflow-x: hidden with display: none for your main element that contains all elements you want to hide. It is impossible to remove the scroll bar by simply changing the value of the overflow-x style.

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

Execution priority of Javascript and PHP in various browsers

I implemented a basic JavaScript function to prevent users from using special characters in the login form on my website: $("#login_button").click(function(){ formChecker(); }); function formChecker() { var checkLogin = docum ...

Navigating SEO strategies for client-side components in Next.js with text content to optimize search engine rankings

I'm currently developing a Next.js application that involves a single shared audio file and multiple text components. Each text component corresponds to a specific timestamp in the audio, updating its state to stay active and highlight when the audio ...

What could be causing the issues with the compatibility of <input type="text" and flex properties?

I'm having an issue where the search box expands in size when I apply display:flex in my CSS. Can someone explain why this happens and offer a solution to return the search box to its normal height? Additionally, I would like the search bar and the se ...

Securing API data: Utilizing encryption techniques in express and nuxtjs to deter scraping efforts

I'm looking for a secure way to encrypt my API data in order to prevent users from viewing it in the network tab or as plain text within objects like window.__nuxt__. Currently, I am following these steps: Encrypting data on the back-end using a sec ...

There was an error: "Uncaught TypeError - onPageChange function is not defined for the DataGrid component in Material

I'm struggling to integrate a DataGrid component into my application. While the table renders correctly with the code provided, I encounter an error when clicking on the next page icon - react-dom.development.js:327 Uncaught TypeError: onPageChange is ...

Can you clarify the purpose of response.on('data', function(data) {}); in this context?

I am curious about the inner workings of response.on("data"). After making a request to a web server, I receive a response. Following that, I utilize response.on("data" ...); and obtain some form of data. I am eager to uncover what kind of data is being p ...

Enhance your form input-group in Bootstrap-4 by adding a stylish border and background-color through validation

I'm working on a form using Bootstrap 4 and I need to display validation errors. Specifically, I want the text field with an input-group for the password to have the same styling as the Username field when there is an error (i.e., red border and backg ...

What is the best way to update the color of a v-select component?

Currently utilizing Vuetify for my project <v-select id="makeMeBlue" dense outlined :items="form.values.urlTypes" label="Single or Multi URL" v-model="form.values.urlType" :rules="form.ru ...

Is there a way to extract both a and b from the array?

I just started learning programming and I'm currently working on creating an API call to use in another function. However, I've hit a roadblock. I need to extract values for variables a and b separately from the response of this API call: import ...

How to position ul at the bottom of a fixed div

I have a fixed sidebar with two ul elements. I attempted to position the blue ul at the bottom of the fixed div, but it is not aligning as intended. <div class="sidebar"> <ul style="background:green;"> <li>test</li> <li>test ...

Having trouble getting my parallax slideshow to work with jquery preventDefault

-UPDATE- After countless hours of online courses, tutorials, and programming, I finally completed my website! Check it out here: The site is almost where I want it to be, but there are a few remaining challenges: 1) AJAX: I'm struggling to get the ...

Ways to retrieve information when text is modified and a dropdown is selected within an input field

I have an input field with a text box and a dropdown. My goal is to trigger data based on text changes in one method, while using another method for the dropdown. Check out the code below. const allList = [ { id: "1", value: "Fruits" ...

Building a node.is script to validate email addresses

This code snippet is for validating email addresses. I have successfully implemented example 5, where the email length must be over 5 characters to avoid errors and prompt users to re-enter their email address. However, I am unsure how to handle examples ...

Unleashing the power of RollupJs: A guide to dynamically bundling modules and objects

Is there a way to dynamically bundle a module/object into my RollupJs output file? I have experimented with various options without success in achieving the desired result. Below is a brief sample project that demonstrates what I am trying to achieve. The ...

Currently struggling to retrieve data from an AJAX post request within a C# controller

I need assistance with sending data from JavaScript to a C# controller using AJAX. However, I am facing an issue where all the arguments in the Add method of my controller are showing up as null. Below is my AJAX code: function sendRequest(name, price, ab ...

Customize the design of a React Material-UI select dropdown by overriding

I am currently utilizing the React MUI Select Component for my forms, specifically for language selection. My issue arises when I need a different style for the dropdown menu of the language Select component. Overriding the relevant class would apply this ...

Learn the process of dynamically expanding a specific Bootstrap menu item using jQuery!

To create a left vertical (sidebar) navigation menu, I will be referencing the "Example" located at https://getbootstrap.com/docs/5.0/components/accordion/. Assuming there are three HTML buttons: <button onclick="myFunction1()">Button 1< ...

The elegant scroll-bar (whether directive-based or not) seems to be having trouble functioning within the ng-view

I am looking to add a stylish scroll bar to a paragraph that is located within the ng-view. My module code appears as follows: var myweb = angular.module('myweb' , ['ngRoute', 'perfect_scrollbar']); myweb.config(function($ro ...

Excess content from the Bootstrap container is spilling over and

Encountered an issue while developing a page using bootstrap5 relating to the positioning of the footer and main content container. Everything was functioning correctly until the addition of the footer: Prior to adding the footer: https://i.sstati ...

The array does not seem to be properly linked in React JS

I've been encountering this error even after trying various solutions based on my knowledge. Any help would be greatly appreciated. The issue arises when I attempt to pass an array in props, retrieve it in the component, and then set the props value ...