Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

195
Views
How to create a div completely separate from left side bar?

I'm quite new to react so bare with me.

I currently have a navigation side bar on the left and it's fixed. I'm trying to create all the pages show up on the right. On those pages, I'm using material-ui Grid.

But I'm having trouble because the container div for the pages on the right extends to the left even to the side-bar so the "screen-size" for the Grid breaks.

Here is the current scenario:

enter image description here

And here is what I want: enter image description here

Here is my current code in CSS for the divs on the right:

.Background {
    min-height: 100%;
    width: 100%;
    position: absolute;
}

.Container {
    min-height:100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    position: absolute;
    padding-left: 250px;
    padding-bottom: 3rem;
    background-color: rgb(252, 249, 251);
}

.background div extending full width is okay because that just sets the background color. However, the container background, I want it shifted to the right. Currently, I'm using a left padding of 250px, which is the width of the sidebar, but this only pushes the components to the left. When I'm trying to use Grid, it still thinks the whole page is the width of the screen.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

.Background {
    min-height: 100%;
    width: 100%;
    position: absolute;
    background: beige;
    overflow:hidden;
}

.Container {
    width:calc(100% - 250px);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: absolute;
    left: 250px;
    padding-bottom: 3rem;
    background-color: rgb(252, 249, 251);
}
<html>

    <body>
        <div class="Background">
            <div class="Container"></div>
        </div>
    </body>

</html>

Did this behave as what you want? I add color to highlight the background.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!