Chrome错误判断屏幕尺寸

时间:2014-04-30 14:45:13

标签: jquery css google-chrome sass

我只是第一次尝试响应设计所以我不确定我是否做了什么,但我认为这只是一个错误。

现在,如果我将部分浏览器移出屏幕并将其展开到大约1345,它会点击我为1224设置的CSS

//So this and @media all are the only ones which work currently
@media only screen and (min-width : 321px) {
/* Styles */
//  div { border: 3px solid purple;}
}
// all others do nothing, confirmed via trial and error
// Works at 1346
@media only screen and (min-width : 1224px) {

  @import "layouts/laptop/layout";
  @include header-large(1224);
  @include logo-mixin;
  @include nav-large(1224);
  @include registrar-mixin;
  @include presenter-mixin(1224);
  @import "bodies/laptop/body";
  @include index-detail-mixin;
  @include show-mixins;
  @include object-location;
}

我使用的是Mac OS Mav,一切都在Safari,FF和Chrome Canary中按预期工作。说实话,自从我添加jQuery UI以来,Chrome一直很奇怪。就像JS工具在开放一段时间后不会运行一样,虽然现在在jshint和一些添加分号的轮次后现在似乎已经解决了。所以,我想这是我的错,但FF和Safari再次没有眨眼。哦,我也尝试禁用所有扩展并重新加载页面,但这也无效。所以,我的CSS知识非常有限。

编辑:我还应该提到这只是几天前发生的事情。在此之前它工作得很好。我早上刚醒来,css停止了工作。

1 个答案:

答案 0 :(得分:2)

这可能听起来很愚蠢,但这是一个容易被忽视的问题,导致我数小时的挫折和尴尬。

仔细检查您的浏览器是否完全没有缩放,并且您正在以默认的100%缩放级别查看该页面。

如果您在浏览器中放大或缩小它将影响媒体查询,它们将无法正确显示。

enter image description here