views:

24

answers:

1

my <html style="overflow-x:hidden; overflow-y:hidden

inside have a div with overflow-x:auto; overflow-y:scroll; min-width:960px; but when my browser viewing mode is larger than 960px, it still showing the horizontal scroll bar. how to make the horizontal scoll bar only show if necessary when width less than 960?

A: 

All you have to do is

<html style="overflow-x:auto; overflow-y:auto>

but it is prettier when 'overflow-y' is set to 'scroll';

Also

overflow-x:auto; overflow-y:scroll;

should be applied to html tag or to :root. Only in that case they will work.

Jevgeni Bogatyrjov
i cannot apply overflow auto at the root or .html. like what you did as i'm using GWT. all my div are underneath iframe. so i have to put overflow in the div
cometta