I'm experiencing an issue with MDL where I see two scroll bars appearing. Is there a solution to resolve this?

Having an issue with 2 scroll bars when using mdl by Google. Here is the HTML code I am using. Any suggestions on how to resolve this? Check out the code on CodePen

<div class="mdl-grid">
    <div class="mdl-cell mdl-cell--8-col mdl-cell--8-col-desktop mdl-cell--12-col-tablet  mdl-cell--12-col-phone">
        <div class="mdl-shadow--2dp mdl-color--white mdl-cell mdl-cell--12-col"></div>
        <div class="mdl-shadow--2dp mdl-color--white mdl-cell mdl-cell--12-col"></div>
    </div>
    <div class="mdl-cell mdl-cell--4-col mdl-cell--4-col-desktop mdl-cell--4-col-tablet  mdl-cell--12-col-phone"></div>
</div>
</div>

Answer №1

There were several issues with your code example.

Multiple layouts

It appears that there was an extra layout in your code that shouldn't have been there. This may have been a mistake when copying and pasting the code.

Nested grids

When using nested grids, it is important to ensure that inner grids are both a mdl-cell and an mdl-grid, otherwise they won't function properly as grids. Make sure each element follows this structure.

<div class="mdl-grid">
  <div class="mdl-cell mdl-grid mdl-cell--8-col mdl-cell--8-col-desktop mdl-cell--12-col-tablet  mdl-cell--12-col-phone">
    <div class="mdl-shadow--2dp mdl-color--white mdl-cell mdl-cell--12-col"></div>
    <div class="mdl-shadow--2dp mdl-color--white mdl-cell mdl-cell--12-col"></div>
  </div>
  <div class="mdl-cell mdl-grid mdl-cell--4-col mdl-cell--4-col-desktop mdl-cell--4-col-tablet  mdl-cell--12-col-phone"></div>
</div>

Menu button placement

The menu buttons were positioned outside of the cards within the grid, causing alignment issues. Placing them inside the cards where intended should resolve this problem.

Repeated IDs

Using the same ID for multiple menu buttons resulted in all menus triggering simultaneously upon click.

Missing classes in menu items

Some menu items were missing necessary classes for proper functionality.


I have addressed these issues and made corrections in this updated version on CodePen.

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

Extract all objects from an array where a specific field contains an array

data:[ { id:1, tags:['TagA','TagB','TagC'] }, { id:2, tags:['TagB','TagD'] }, { id:3, tags:[&a ...

Ways to ensure a form label is accessible via keyboard navigation

My HTML5 form collects user information and processes it upon submission. With the help of the jQuery Validation Plugin, input validation is performed. In case of errors, an error-message-container div is displayed at the top of the screen, listing all err ...

Switching out nested loop within JavaScript

I've come across an array of objects that looks like this let data = [ { "id": 1, "name": "Sam", "father": true, "group": "orange" }, { &qu ...

Express identifies the user, however, the username is displayed exclusively on one specific page. This situation may indicate a potential cookie problem

I am in the process of developing an express app integrated with MongoDB. The issue I am facing involves a pug template for the navigation bar where I aim to display the user's name at the top upon logging in. Strangely, it only works on the page that ...

Personalized cursor image using jQuery.css()

I have designed a .png image that I want to use as a custom cursor for a particular element with the class "next". Here is the code I am using, but it doesn't seem to be working. Is there anything important that I may have overlooked? $('.next& ...

Is it feasible to adjust the Scrollbar's position?

Is there a way to change the position of a scrollbar on a webpage? Are there any alternative solutions for this issue? <div style="overflow: scroll; overflow-y: hidden"> </div> I am looking to relocate the scrollbar to a different componen ...

Trouble sending data with jQuery AJAX request

I've been experimenting with an Ajax request, but I'm having trouble figuring out why this code isn't sending any parameters to the JSP and is throwing a NullPointerException. I've fixed my code now, thanks for the responses. var dfd ...

React Enzyme Issue: Unable to access the property 'propTypes' as it is undefined

Here is a simple React Component I have created: import React from 'react' var PageLeftLower = React.createClass({ render:function(){ return(<a href="#">Quote Requests</a>); } }); module.exports = PageLeftLower; I am new t ...

Organizing stepper elements within a wrapper with bootstrap for a seamless layout

I am struggling with making a list of header icons in a Stepper container responsive to page size changes. I have attempted to adjust the placement of the container within different div elements, but it has not yielded the desired results. My current setu ...

Looping through an array in PHP

Is there a way to loop through an array in my code? Here is the initial version of my script: $val=array( array("value" => "Male","label" => "Male"), array("value" => "Female","label" => "Femal"), ); my_form("Gender","select","gender",$va ...

Revitalize JustGage using jQuery

I made a mistake while using jquery to refresh my JustGage gauges. The data from the controller is retrieved successfully, but unfortunately, I encountered an issue where the computer eventually runs out of memory and freezes. With 9 gauges and 2 pie chart ...

Tips for incorporating unique images into each individual flex box

I am new to the world of coding, having just embarked on this journey less than a week ago. Following a tutorial by a developer on YouTube, I tried to add my own twist to the project in order to differentiate it from the original. However, I've hit a ...

What is the best way to convert a string in JavaScript to be case-insensitive?

Can anyone assist me? Challenge: Develop a function called indexOfIgnoreCase which takes in two strings and identifies the first instance of the second string within the first string. This function should be insensitive to letter case. For example, indexO ...

NodeJS is throwing a SyntaxError due to an unexpected identifier when trying to render on res.Render

When trying to send a variable using res.Render(), I am experiencing an error on the client side. I want to send an object that contains arrays: In NodeJs: var countries_lat_lng = []; trip.countries.forEach(country => { var countr ...

Displaying hidden Divs in React Typescript that are currently not visible

I have an array with various titles ranging from Title1 to Title8. When these titles are not empty, I am able to display their corresponding information successfully. Now, my goal is to include a button that will allow me to show all fields. For example, ...

What are the distinctions between executing a c++ function and a JavaScript function?

After attempting to execute the c++ program provided below, a compilation error occurred. However, when trying to execute the second javascript code snippet below, no errors were detected. Why is this? ////c++//// #include<iostream> using namespace ...

Developing object instances using AngularJS

Looking for some guidance on creating an object using Angular's factory capabilities since I'm new to AngularJS. Here's the code snippet that I have: angular.module('7minWorkout') .factory('WorkoutPlan', function(args){ ...

Ways to safeguard NextJS Route Handlers from unauthorized access beyond my website

While using the NextJS 14 App Router, I noticed that my Route Handlers for APIs were accessible to my friend via Postman from his PC. This was unexpected as I assumed they were protected by default due to the same-origin policy headers in NextJS. However, ...

The Front End API is unable to locate the Back End Endpoint

I am currently setting up an API call to test the functionality of my backend server. The front end is built using React, while the back end utilizes Node.js with express. The endpoint on the backend is quite simple: app.get('/', (req, res) => ...

What is the best way to reverse an EJS forEach loop?

Here is my ejs code to display images and names from my database. How can I reverse the array order to show the images and names in reversed order? <% posts.reverse().forEach(function(post){ %> <div class="col-md-3 col-sm-6"> ...