嗨,我在应用程序中使用媒体查询来使网页响应。我以前从未用过。
我在CSS中使用媒体查询,如下所示:
@media screen and (min-width: 70em) {
div.MoreInfoterms {
width: 800px;
margin-right: 250px;
margin-left: 55px;
margin-top: 20px;
border: 1px solid #cecece;
background-color: #f7f9f9;
max-height: 700px;
margin-bottom: 20px;
}
}
这是我的HTML:
<div class="MoreInfoterms">
<ul>
<li> <p> This App has no minimum term.</p> </li>
<li> <p>This App has no minimum term.</p> </li>
<li> <p>This App has no minimum term..</p> </li>
</ul>
</div>
http://jsfiddle.net/isherwood/LBuTj
在这两种情况下,当我最小化浏览器并且媒体查询开始生效时,我只能看到没有样式的内容。那么有人可以帮我吗?
最佳答案
用这条线
@media screen and (min-width: 40em)
如果浏览器的大小大于
40em
,则将使用样式设置元素。因此,要执行补数功能,可以关闭媒体查询声明或创建新样式:@media screen and (max-width: 40em)
查看此演示http://jsfiddle.net/LBuTj/2/
关于css - 当我在CSS中使用媒体查询时,我失去了样式,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19959180/