Media queries 未在CSS中读取移动条件语句的设备

Media queries 未在CSS中读取移动条件语句的设备,media-queries,conditional-statements,Media Queries,Conditional Statements,我正在创建一个响应性很强的布局,除了320像素宽的智能手机之外,它在大多数格式上都非常有效。我在CSS和一个单独的样式表中都使用了媒体条件,这两种方法都不起作用,就好像设备忽略了条件代码一样 对于480px及更高的设备,我的原始CSS如下所示: #logo { position:relative; margin-top:30px; margin-left:auto; margin-right:auto; text-align:center; width:100%; height: 117px;

我正在创建一个响应性很强的布局,除了320像素宽的智能手机之外,它在大多数格式上都非常有效。我在CSS和一个单独的样式表中都使用了媒体条件,这两种方法都不起作用,就好像设备忽略了条件代码一样

对于480px及更高的设备,我的原始CSS如下所示:

#logo
{
position:relative;
margin-top:30px;
margin-left:auto;
margin-right:auto;
text-align:center;
width:100%;
height: 117px;
background-image:url(../images/logorepeat.png);
background-position:0px 26px;
background-repeat:repeat-x;
z-index:50;
}

#landscape
{
position:relative;
margin-top:-27px;
margin-left:auto;
margin-right:auto;
padding-top:45px;
text-align:center;
width:100%;
height:120px;
background-image:url(../images/plated2.jpg);
background-repeat:repeat-x;
background-color:#efebe5;
z-index:40;
}
因为我不需要在320px的设备(如iPod Touch)中重复背景,所以我在该设备的调用中删除了它,并将其上方的div向上移动:

@media screen and (max-width: 320px)
{

#logo
{
position:relative;
margin-top:30px;
margin-left:auto;
margin-right:auto;
text-align:center;
width:100%;
height: 117px;
z-index:50;
}

#landscape
{
position:relative;
margin-top:-45px;
margin-left:auto;
margin-right:auto;
padding-top:45px;
text-align:center;
width:100%;
height:120px;
background-image:url(../images/plated2.jpg);
background-repeat:repeat-x;
background-color:#efebe5;
z-index:40;
}

}
有什么建议吗


谢谢

我已经回答了我自己的问题!我只是将我制作的iphone样式表作为默认样式表,并以最小到最大的顺序链接到HTML头部的媒体查询样式表: