javascript - 相对布局,移动版显示不正确.. HTML/CSS

标签 javascript html css layout

不寻常的问题,我只是想不通它为什么会发生,基本上我尝试通过 responsinator 查看网站 一切看起来都很好,当调整浏览器大小时它似乎也很好(即使是移动大小)但是当在 iphone 上查看网站时它似乎根本没有听媒体查询..

http://jsfiddle.net/z5jVJ/

验证整个 css 时我得到以下信息

Parse Error
@media only screen and (max-width: 600px) {

#container {
    margin: 0 auto;
    max-width: 85%;
    overflow: hidden;
}

nav #pull {
    position: absolute !important;
    top: 5px !important;
    left: 5px !important;
}

nav ul {  
    display: none;  
    height: auto;  
}  

nav a#pull {  
    text-align: left;
    margin-top: -3px;
    font-family: 'Oswald', sans-serif;
    font-weight: 300;
    font-size: 18px;
    display: block;  
    width: 90%;  
}  

nav a#pull:after {  
    background: url('nav-icon.png') no-repeat;   
    height: 1px; 
    display: block;
    position: absolute;  
    right: 15px;  
}

#mainHeader nav {
    text-align: center;
    min-height: 25px;
    height: 100%;
    width: 100%;
    border-bottom: 1px solid #dfdfdf;
}

#mainHeader nav ul li {
    padding: 10px;
    margin-top: 23px;
    font-size: 16px;
}

#mainHeader nav ul li a {
    padding: 0px;
}

#mainHeader nav a:hover {
    color: #dfdfdf;
}

#mainHeader ul {
    list-style: none;
    margin: 0 auto;
    height: 53px;
}

#mainHeader nav ul li a {
    padding: 0px 0px;
}

.banner .label {
    margin-bottom: 5px;
    width: 50%;
    -webkit-border-top-right-radius: 5px;
    -webkit-border-bottom-right-radius: 5px;
    -moz-border-radius-topright: 5px;
    -moz-border-radius-bottomright: 5px;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;    
}

.banner .category {
    text-align: right;
    min-width: 96.5%;   

}

#mainContent { 
    float: right;
    width: 100%;
}

#mainContent img {
    width: 96.5%;
}

.article {
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;   
}

#footer { 
    height: 50px;
}
    }

有什么想法吗?

最佳答案

尝试更改媒体查询,验证 CSS 后出现“解析错误”。

所以改变这个:

@media only screen and (max-width: 600px)

对此:

@media only screen and (max-device-width: 480px)

关于javascript - 相对布局,移动版显示不正确.. HTML/CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17830425/

相关文章:

javascript - 混淆您的jquery代码

javascript - 托管在共享点上时 D3 工具提示与鼠标的位置偏移

html - 列表溢出到 Div

javascript - Vue.js 破坏了 Google map 功能

javascript - jQuery 表,可点击下拉列表 - 多个隐藏行?

javascript - 代码不会验证

javascript - jQuery Wrapp 独特的元素

html - 任何文本的 CSS 超链接

javascript - 在 React 组件内渲染样式元素

android - 透明背景与前景图像的颜色