【发布时间】:2014-04-05 23:00:47
【问题描述】:
谁能告诉我为什么这会起作用
/* small desktop */
@media all and (max-width: 1200px) {
}
/* tablet */
@media all and (max-width: 1024px) {
}
/* mobile phone */
@media all and (max-width: 768px) {
}
但这不是:
/* mobile phone */
@media all and (max-width: 768px) {
}
/* tablet */
@media all and (max-width: 1024px) {
}
/* small desktop */
@media all and (max-width: 1200px) {
}
因为最后一个样式总是覆盖以前的样式,例如:
[class=foo]{
background:red;
background:yellow;
}
输出:
.foo background yellow
【问题讨论】:
标签: css responsive-design media-queries