css - 为什么我的 CSS 媒体查询会破坏样式?

标签 css media-queries fluid-layout

我正在尝试使我的侧边栏流畅,以便它随浏览器窗口进行调整,一切似乎都运行良好,除了添加媒体查询后,我的 CSS 样式中断了,但是当我接受查询时离开它又回到了我样式表中的规范样式。有人可以看看我的代码并告诉我我做错了什么吗?提前致谢!

顺便说一句,当我将第二个结束花括号添加到#rightandoverview 媒体查询时,样式恢复到应有的方式,但流动性不起作用。会是什么呢?

#righthandoverview {
position: absolute;
top: 91px;
right: 0px;
width: 20%;
height:215px;
background-color: white;
webkit-box-shadow: 0px 4px 5px -5px #777;
-moz-box-shadow: 0px 4px 5px -5px #777;
box-shadow: 0px 4px 5px -5px #777;
}

@media screen and (max-width:830px) and (min-width:100px) {
#righthandoverview {
    float: left;
    width: 30%;
    background-color: yellow;
    margin-top: 5px;

}





#righthandoverview ul {
position: absolute;
display: inline;
float: left;
font-family: klavika-light;
list-style-type: none;
text-decoration: none;
white-space: nowrap;
}

@media screen and (max-width:830px) and (min-width:100px) {
#righthandoverview ul {
    float:left;
    width:30%;
    background-color: yellow;
    margin-top: 10px;

}
}




#righthandoverview ul li > a {
display: inline;
text-decoration: none;
color:#8BAFDA;
}   

#righthandoverview ul li {
padding-bottom: 6px;
}

最佳答案

看起来您缺少一个括号来结束您的第一个媒体查询

@media screen and (max-width:830px) and (min-width:100px) {
#righthandoverview {
    float: left;
    width: 30%;
    background-color: yellow;
    margin-top: 5px;

}





#righthandoverview ul {
position: absolute;
display: inline;
float: left;
font-family: klavika-light;
list-style-type: none;
text-decoration: none;
white-space: nowrap;
}
}

关于css - 为什么我的 CSS 媒体查询会破坏样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12593538/

相关文章:

html - 与媒体查询交换 div 位置

css - 我需要为每个宽度范围添加媒体查询吗?

javascript - 我在使用流畅的布局时遇到问题

javascript - 如何使元素在响应式布局中向下流动然后横向流动

html - 导航栏干扰 div - HTML/CSS

javascript - 为什么更改 InnerHtml 时此 div 会下拉?

jquery - 仅使用 jquery 获取被 css 隐藏的可见单词

css - 图标字体在不同计算机上显示不一样

html - 该网站如何实现流体/液体布局

html - 如何使我的网站流畅?