我想为一个文档制作多个响应式 css 样式表。所以我这样做:
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" href="responsive.css" media="screen and (max-width: 900px)">
<link rel="stylesheet" type="text/css" href="responsive_1056.css" media="screen and (max-width: 1056px)">
一旦达到 1056,就会执行 responsive_1056.css 文件。但是一旦达到 900px,responsive.css (max-width: 900px) 就不会执行。
发生这种情况有原因吗?我该如何解决?
最佳答案
Responsive.css 可能被拾取,但随后被 responsive_1056.css 中的数据覆盖
编辑最后一个链接以包含(最小宽度:900px)应该可以完成这项工作。
<link rel="stylesheet" type="text/css" href="responsive_1056.css" media="screen (min-width : 900px) and (max-width: 1056px)">
关于html - 一个文档可以有超过 1 个响应式 CSS 样式表吗?如果是这样,如何?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25316885/