Media Queries min-width not firing correctly in Opera, FF and IE

自闭症网瘾萝莉.ら 提交于 2019-12-04 15:43:39

Problem in width of scrollbar in BODY or HTML - it about 16-18px.

What to do?

  1. Bad solution - set to BODY or HTML overflow-y: scroll.
  2. Experimental solution - try to move scrollbar from BODY or HTML to first wrapper DIV.

Like so:

body, html { overflow: hidden; height: 100%; }
div.wrapper { overflow: auto; height: 100%; }

I just had the same Problem and found a solution, at least for me. I didn't test it a lot, so please let me know if there is something I didn't consider.

In the media query I set min-width of the body to the min-width of the media-query. It works!

@media only screen
and (min-width : 1060px) {
    body{
        min-width: 1060px;
    }
    #main-content{
        text-align: right;
        padding-left: 0;
    }
}

I made an example for this problem and solution here:

http://gehirnstroem.at/media-query.htm

http://gehirnstroem.at/media-query-solved.htm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!