2013-11-22 67 views
0

这是我的CSS:为什么我的CSS媒体查询被忽略或覆盖? (tumblr)

@media screen and (max-width: 640px){ 
.double{width:260px;} 
.double img{width:100%;height:auto;} 
.title {font-size:50px;} 
} 

不管我多么编辑@media screen and (max-width: 640px)财产,没有什么工作。我也尝试添加!important,但它不起作用。

好像我@media属性被忽略/覆盖,因为当我调整浏览器和检查元素(在火狐),所使用的CSS仍然.double img{width:560px;}当它应该是.double img {width:100%;height:auto;}

任何帮助将是真的不胜感激! :)

Here's my Tumblr. 如果有帮助,我的JSFiddle是here

回答

0

它只是一个语法错误在.capz类,中庸之道引起媒体查询之前:

.capz { 
    opacity:0; 
    filter:alpha(opacity = 0); 
    -webkit-transition: all 0.3s ease; 
    -moz-transition: all 0.3s ease-in-out; 
    -o-transition: all 0.3s ease-in-out; 
    -ms-transition: all 0.3s ease-in-out; 
    transition: all 0.3s ease-in-out; 
    position: absolute; 
    background: rgba(255,255,255; //missing closing parenthesis 
    width: 100%; 
    height: 100%; 
    bottom:3px; 
} 

@media screen and (max-width: 640px){ 
    .double{width:260px;!important} 
    .double img{width:100%!important;height:auto !important;} 
    img {max-width: 100% !important;height: auto !important;} 
} 

(注:你不需要在这种情况下!important标签了)

Updated fiddle

+0

我一直在试图弄清楚现在天有什么问题,不能相信我错过了这个!我真的觉得自己像一个白痴现在哈哈。谢谢!! :) – user2446412

+0

@ user2446412很高兴能有所帮助,请将此问题设为回答,如果您认为是。 – zessx