【发布时间】:2013-10-18 01:30:46
【问题描述】:
我有一个这样的css代码:
@charset "utf-8";
/* long code just an example of top */
.show_hide_top a.showLink { /* small red link */
left: 39% !important;
padding-left: 8px;
top: 15% ;
}
@media only screen and (min-width: 1300px) and (max-width:1500px) {
/* long code for these devices ex: */
.show_hide_top a.showLink {
left: 39% !important;
padding-left: 8px;
top: 18% ;
}
}
@media only screen and (min-width: 769px) and (max-width:1299px) {
code for these devices
}
@media only screen and (min-width:481px) and (max-width: 768px) {
code for these devices
}
但是,我的计算机 (1600) 获取了 1300-1500 的媒体代码。 有些东西(可能是愚蠢的)是错误的。
非常感谢您的意见。
【问题讨论】:
-
1600是指视口大小还是您的屏幕大小?您能否填写一个重现问题的示例小提琴? -
屏幕尺寸。 (免责声明 - 我是编程新手,我不确定有什么不同。我正在使用whatismyscreenresolution.com 谢谢你的提问。
-
好吧,那些媒体查询正在检查浏览器视口,而不是屏幕大小。如果这是目的,您应该尝试使用
min-device-width和max-device-width -
成功了!我什至尝试过并将其注释掉,但我并没有用于所有级别。现在我在每一个层次上都写了,而且效果很好。谢谢!请把它作为答案。您介意解释一下视图大小和屏幕大小之间的区别吗?没什么大不了的,我可以找出来。非常感谢!
标签: css responsive-design media-queries