Disable horizontal scrollbar due to a DIV with position:absolute which is outside of the page

后端 未结 7 2379
太阳男子
太阳男子 2020-12-28 13:59

I have an absolutely positioned element that is \"outside\" of the page, but I want browsers (I am using Firefox 3) not to display horizontal scrollbars. It seems that displ

7条回答
  •  被撕碎了的回忆
    2020-12-28 14:47

    Add this to your CSS:

    div {
    overflow-x:hidden;
    overflow-y:hidden;
    }
    

    The overflow-x and -y styles are not recognized by IE. So if you're only concerned with Firefox 3, this will work fine. Otherwise, you can use some javascript:

    document.documentElement.style.overflow = 'hidden';  // firefox, chrome
    document.body.scroll = "no";    // ie only
    

提交回复
热议问题