Answer the question
In order to leave comments, you need to log in
Why doesn't overflow-x work on a fixed div?
I can't get a scrollbar placed inside a parent with position: fixed
.
Situation example:
.parent {
position: fixed;
width: 100%;
min-width: 200px;
height: 100%;
background: lightblue;
}
.child {
float: right;
height: 100%;
width: 200px;
background: lightgreen;
overflow-x: scroll;
overflow-y: hidden;
}
<div class="parent">
<div class="child">
</div>
</div>
Answer the question
In order to leave comments, you need to log in
You're overlooking that overflow-x: scroll fires when the content doesn't fit in the block. Since your block is empty, there is nothing to scroll. Try to insert an image there, the width of which obviously exceeds the width of the block.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question