【发布时间】:2013-11-21 18:48:13
【问题描述】:
我正在设计一个响应式网站(我首先开发的主页是除了会话开始之外的所有 html,但有些页面会有很多 php,所以很明显我将主页保存为 php) .当我在我的 MAMP 服务器上进行测试时,一切正常——它在任何屏幕尺寸下都正确加载了所有 CSS。但是,当我将它加载到我的 fatcow 服务器上进行测试时,如果将浏览器缩小到为桌面模式设置的宽度以下,它根本不会加载 CSS(一切都变为默认值 - 黑色文本,没有颜色变化,没有边界,一切都是左对齐的,等等)。但是,如果您将浏览器窗口设置为最小的桌面尺寸,CSS 就会神奇地出现。我有响应式元标记(见下面的代码)。为什么 CSS 总是链接在我的 MAMP 服务器上,但有条件地加载到互联网上?谢谢!
索引页头代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!--[if lt IE 7]> <html class="ie6 oldie"> <![endif]-->
<!--[if IE 7]> <html class="ie7 oldie"> <![endif]-->
<!--[if IE 8]> <html class="ie8 oldie"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="">
<!--<![endif]-->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Home</title>
<link href="boilerplate.css" rel="stylesheet" type="text/css">
<link href="index.css" rel="stylesheet" type="text/css">
<!--
To learn more about the conditional comments around the html tags at the top of the file:
paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
Do the following if you're using your customized build of modernizr (http://www.modernizr.com/):
* insert the link to your js here
* remove the link below to the html5shiv
* add the "no-js" class to the html tags at the top
* you can also remove the link to respond.min.js if you included the MQ Polyfill in your modernizr build
-->
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="respond.min.js"></script>
<link rel="stylesheet" href="ajxmenu.css" type="text/css">
<script src="ajxmenu.js" type="text/javascript"></script>
<link rel="stylesheet" href="ajximagerotator.css" type="text/css">
<script src="ajximagerotator.js" type="text/javascript"></script>
</head>
如您所知,我正在使用 Dreamweaver 设计此站点。我以前在 Notepad ++ 中编码时遇到过类似的问题,但通常 Dreamweaver 非常擅长这种事情,而无需我进行大量调整。
提前感谢您的帮助!
编辑:顺便说一句,刚刚在我的 Linux VirtualBox 中使用 LAMP 进行了测试 - 在那里也可以正常工作。我想这可能是 Fatcow 的设置,但我不知道该去哪里。
【问题讨论】:
-
你能看到你浏览器的开发工具中加载的 CSS 文件吗?
标签: php html css remote-server localserver