C
C
Chips862018-02-09 07:41:11
css
Chips86, 2018-02-09 07:41:11

How to pin content to a menu?

When scaling the screen, the right side of the site (content) slides either to the left or to the right. How to pin content to a menu?
You can see an example of how it looks here and here .

<div id="container">
    <div id="sidenav-menu">
        <app-sidenav-menu></app-sidenav-menu>
    </div>
    <div id="content">
        <router-outlet></router-outlet>
    </div>
</div>

#container {
    width: 100%;
    height: 100%;
}

#sidenav-menu {
    position: fixed;
    left: 0%;
    width: 25%;
}

#content {
    width: 75%;
    position: fixed;
    left: 300px;
    right: 0%;
    height: 100%;

}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2018-02-09
@destroer18

#container {
    width: 100%;
    height: 100%;
}

#sidenav-menu {
    position: fixed;
    left: 0%;
    width: 25%;
}

#content {
    width: 75%;
    position: fixed;
    left: 300px; <--убрат
    right: 0%;
    height: 100%;

}

https://jsfiddle.net/hpgnjpbh/4/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question