I'm trying to realize a Flex-layout
with hidden scrollbars which I have realized. But now I also need a absolute/fixed button and I have failed to get it to work.
Without hidden scrollbars it works:
But when I hide the scrollbars the button sticks to the top which is undesirable.
<style>
.root {
background-color: #fff;
display: flex;
height:100%;
}
.pane {
flex-grow: 1;
flex-shrink: 1;
display: flex;
overflow-x: hidden;
overflow-y: visible;
-ms-overflow-style: none;
height: 100%;
width: 400px;
}
.pane::-webkit-scrollbar {
display: none
}
div.pos {
position: absolute;
right: 0px;
width: 32px;
height: 32px;
background-color: #01689B;
color: #fff;
}
</style>
<div class="root">
<div class="pane">
<div class="pos">x</div>
<div style="height: 2000px">
Lorem ipsum dolor sit amet, etc etc
<br/> Lorem ipsum dolor sit amet, etc etc
<br/> Lorem ipsum dolor sit amet, etc etc
<br/> Lorem ipsum dolor sit amet, etc etc
<br/> The button should stick to the right of the text and scroll width the text;
</div>
</div>
</div>