Content resize when left side bar toggled

I’m trying to make the content resize when I toggle my left side bar just like it’s done in Google Contact

Example: enter image description here

Here is my code: https://codepen.io/revatto/pen/ExPpeoE

With the code above, my content get pushed with:

margin-left: 250px; 
Add Comment
2 Answer(s)

in your css:

    .container {   width: 100%;   height: 100vh;   position: fixed; } 

instead of relative

Answered on July 16, 2020.
Add Comment

Set the .container-position to fixed instead of relative:

Before:

.container {    ...    position: relative; } 

After:

.container {    ...    position: fixed; } 
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.