Firefox & CSS3: using overflow: hidden and box-shadow

前端 未结 7 2173
深忆病人
深忆病人 2021-02-07 19:40

I\'m not sure whether this bug applies to Firefox only or also to WebKit-based browsers, but it\'s really, really annoying.

I\'ve got a template/framework for my CMS in

7条回答
  •  离开以前
    2021-02-07 20:11

    Skip to second paragraph for actual solution.

    Depending on your needs my issue and solution I found for myself might satisfy your needs. I found that my issue was quite similar, no scrollbar when body { overflow: hidden; }, reason being, I believe, that the html and body elements' sizes are actually dictated by the size of the browser window's viewable area.

    solution: If you only issue is the overflow off the x-axis, you can do body{ overflow-x: hidden; }, then using javascript or media queries you can easily change the properties applied to the body element and change it back to whatever you please.

    example:

    body { overflow-x: hidden; }
    
    @media screen and (min-width: 1200px) {
        body { overflow-x: visible; }
    }
    

    hope this helps.

提交回复
热议问题