我试图了解为什么我的页面在使用台式电脑时加载了错误的 css 文件。
这是我的代码:
<link href="<?php echo base_url('assets/css/bootstrap.css')?>" rel="stylesheet">
<link rel="stylesheet" type="text/css" media="screen and (max-width: 480px)" href="<?php echo base_url('assets/css/rh-mobile.css')?>" />
<link rel="stylesheet" type="text/css" media="screen and (min-width: 481px) and (max-width: 767px)" href="<?php echo base_url('assets/css/rh-tablet.css')?>" />
<link rel="stylesheet" type="text/css" media="screen and (min-width: 768px) and (max-width: 3000px)" href="<?php echo base_url('assets/css/rh.css')?>" />
当我检查 Firefox 的 Web 控制台时,我可以看到我收到了一堆错误消息,例如:
[11:54:09.149] Error in parsing value for 'font-weight'. Declaration dropped. @ https://myserver/myapp/assets/css/rh-mobile.css:13
[11:54:09.150] Unknown property '-moz-border-radius'. Declaration dropped. @ https://myserver/myapp/assets/css/rh-mobile.css:22
[11:54:09.150] Error in parsing value for 'background-image'. Declaration dropped. @ https://myserver/myapp/assets/css/rh-mobile.css:74
[11:54:09.150] Unknown property '-moz-box-shadow'. Declaration dropped. @ https://myserver/myapp/assets/css/rh-mobile.css:170
我没想到它会尝试使用移动 CSS。我的桌面屏幕分辨率是 1920 X 1200。
你能告诉我为什么 rh-mobile.css 被加载/我哪里出错了吗?
谢谢。