USSURATONCAHI
USSURATONCAHI

Reputation: 105

How to remove scrollbar on web page, while it isnt required?

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

Answers (3)

ALI AHMER
ALI AHMER

Reputation: 1

Use

.popup-window {
    overflow-y: hidden;
}

Upvotes: -2

Ranjeet Eppakayala
Ranjeet Eppakayala

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

Yuriy Lukinskikh
Yuriy Lukinskikh

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

Related Questions