The elements on the webpage are spilling over with content

I encountered an issue while creating a dashboard with a sidebar on the left side. When adding content to the page, some of it ended up hidden behind the sidebar. I tried using overflow-x:auto and this was the result: https://i.stack.imgur.com/5qHJY.jpg Below is the code snippet for the dashboard:

.container {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
}

.sidenav {
  position: absolute;
  float: left;
  height: 100%;
  z-index: 1;
  left: 0;
  overflow-x: hidden;
}

.content {
  float: right;
  margin-left: 5rem;
}
<div class="main">
  <div>
    <app-header></app-header>
  </div>
  <div class="container ">
    <div class="sidenav">
      <app-sidebar></app-sidebar>
    </div>
    <div class="content">
      <router-outlet></router-outlet>
    </div>
  </div>
</div>

Upon removing overflow-x:auto from the 'container', the layout experienced issues like these: https://i.stack.imgur.com/Nvawc.png

Seeking advice on how to address this dilemma. Appreciate any assistance provided.

Answer №1

After some troubleshooting, I was able to successfully resolve the issue.

Here is what I did to fix it. dashboard.html:

<div class="d-flex flex-column h-100 w-100">
  <div>
    <app-header></app-header>
  </div>
  <div class="d-flex flex-grow-1 h-100 w-100">
    <div>
      <app-sidebar></app-sidebar>
    </div>
    <div>
      <router-outlet></router-outlet>
    </div>
  </div>
</div>

dashboard.css

*{
    overflow-y: 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

Error 404: Webpack Dev Server Proxy Not Found

Recently, I joined a new team where I am tasked with getting familiar with the project code as a freshman. The project is built using Angular2 and Spring Boot, along with Webpack for bundling assets and proxy settings through Webpack Dev Server to connect ...

Angular allows for routing two distinct paths to separate components located within the same lazily loaded submodule

There are two paths available: /a and /b Both routes lead to the same child module in the parent module: // app-routing.module.ts { path: 'a', loadChildren: () => import('./m-child/m-child.module').then(m => m.ChildModu ...

What is the best way to adjust the font weight of a Bootstrap 4 modal header?

Is there a way to adjust the font weight in the header of a Bootstrap 4 modal? As an added challenge, I'm also interested in changing the font color to #7f7f7f... <div class="modal" tabindex="-1" role="dialog"> <div class="modal-dialog" r ...

Trouble encountered when attempting to download PDF using jQuery

I have encountered an issue while trying to download a PDF using Ajax response HTML. Here is the code I am using: var newPDFAction = function () { $.ajax({ type: "post", url: '{{ route("admin.getCustomerSalesRepTota ...

Addressing some minor visual inconsistencies in an HTML bullet-pointed list

After reviewing my current code, it is displaying the following: https://i.stack.imgur.com/dvjrc.jpg I am attempting to make the following changes: Ensuring each line in the list fits properly within its corresponding box by utilizing vertical-align: to ...

CSS shapes are extending beyond the boundaries of their parent container

I'm working on a small webpage and I am trying to incorporate 2 shapes in the background (see design screenshot attached). Using CSS, I created these shapes but I am facing an issue where the bottom right shape keeps extending beyond the container, ca ...

Troubleshooting: Issues with React Material-UI breakpoints not functioning

Trying to create a responsive navbar using Material-UI. The goal is to hide the IconButton between 960px and 1920px, and display it from 0px to 960px. However, it seems to work only below 960px. Here's a snippet of the code for IconButton and ul: ...

Embed the YouTube video using the URL in the video tag

I tried using the <video> tag, but I'm having trouble getting it to play videos from YouTube. Even though I found this http://jsfiddle.net/wCrNw/, it doesn't seem to work as expected. I also consulted Show Youtube video source into HTML5 ...

Sass-loader in Webpack fails to recognize the use of '@' symbol and raises an error

I am facing an issue with loading a SCSS file through webpack. It seems like many others are experiencing the same problem without any clear explanation. Essentially, I am encountering this error: ERROR in ./src/app/theme.scss Module parse failed: C:&bso ...

"Maintaining Consistency: Ensuring The First Row is Repeated on Every

When trying to save a PDF using jspdf, I encountered an issue with tables in my HTML. The tables do not have headers, but JsPDF is automatically repeating the first row of the table on every page, causing overlap. I don't want headers on every new pag ...

Verify the information retrieved from the JSON document

I have a JSON file containing 10 records, and I am continuously adding these records to a list as the page is scrolled. This results in the data being appended dynamically. My goal is to stop appending more data once all the records from the JSON file hav ...

How do you center controls within a repeater control's item template?

I have a repeating control on my page that displays an image and a hyperlink one below the other. When I add more than one line of text, it causes the image to move up. I want the top of the images to be aligned horizontally and the text to flow downward i ...

Sliced Text Transformation

Recently, I inquired about a pesky text effect that was bothering me. Thanks to the assistance of fellow users, I discovered that the culprit behind the effect was the background color's edge. Eliminating this problem should be simple, but even with ...

Matching the value of an Angular 4 FormGroup with an item in an array

In order to ensure that the input of the country in my form matches one of the countries in my predefined country list, I am looking to implement a custom validation function for my form group. Here is the list of available countries: this.sharedService. ...

React Native formInput Component with Underline Decoration

Utilizing the FormInput element in React Native Elements, I have observed a line underneath each FormInput component. Interestingly, one line appears fainter than the other. This is how the form looks: <View style={styles.container}> ...

Ways to eliminate basic text from HTML/HAML

Seeking a solution to align an image with CSS that is being hindered by unwanted text appearing next to it in Inspect Element. Despite pinpointing the source of the issue, attempts to remove the text have been unsuccessful and it continues to be a nuisance ...

Master the art of string slicing in JavaScript with these simple steps

I am attempting to utilize the slice function to remove the first three characters of a string within a JSON object. $(document).ready(function() { $.ajaxSetup({ cache: false }); setInterval(function() { $.getJSON("IOCounter.html", functio ...

My route seems to be malfunctioning, can someone please help me troubleshoot the

There seems to be an issue with my route in the app-routing.module.ts file because I encounter errors when I visit this page: However, everything works fine when I go here: import { NgModule } from '@angular/core'; import { Routes, Router ...

Adding a PHP file into an HTML page using JavaScript include

Recently, I was assigned to collaborate with a third-party vendor who displays movie times on their platform. We were given the opportunity to co-brand our website on their platform by creating a wrapper for our site. This wrapper would allow the movie tim ...

What causes the discrepancy in margin values between desktop and mobile devices?

In my project, I have a collection of div elements that need to be spaced vertically from one another by the height of the window plus an additional 100px. However, I encountered a discrepancy when setting this margin using jQuery between mobile and deskto ...