Reputation: 105
I have a popup menu and i want scrollbar to appear only when it can scroll ("when overflow"). But if i apply
.popup-window {
overflow-y: scroll;
}
It appears like this (dont care about text): Screenshot
On real page it looks worse
Upvotes: 0
Views: 60
Reputation: 3028
Use overflow:auto
to make it work with overflow-x
and overflow-y
.
It will only add scrollbar if it is needed.
.popup-window {
overflow: auto;
}
Upvotes: 1
Reputation: 65
It's simple, you shouldn't add overflow-y: scroll, you need default property
.popup-window {
overflow-y: auto;
}
Scroll will appear if block overflow by y. Probably you need to add overflow-x: hidden;
Upvotes: 3