HTML Wamp - 需要调试

发布于 2024-09-16 02:36:17 字数 642 浏览 2 评论 0原文

好吧,我构建了一个工作绝对正常的页面,如下所示:

alt text

但是当我将文件夹复制到 < code>C:\wamp\www\myFolder 并使用 WAMP Server 通过 localhost 运行它,它看起来像这样

alt text

问题是附加的样式表不起作用,并且 Java 脚本不起作用。

见下文 alt text

  • 在您看到绿点的地方,图像加载正常...
  • 在您看到粉红点的地方,图像是未加载
  • 您看到黑点的位置。红色部分有 5 个框...它们是 javascript 翻转图像,它们已加载但无法正常工作。一旦鼠标悬停在翻转图像上,
  • 您可以看到的位置不会显示在右上角黄色框..链接、文本框和按钮附加了 css 样式,但不起作用...

发生了什么

Well I built a page which is working absolutely fine as you can see below:

alt text

but when i copy my folder to C:\wamp\www\myFolder and run it through localhost using WAMP Server it look something like this

alt text

the problem is that the attached Style Sheets are not working and the Java Script is not working.

see below
alt text

  • where you see the green dots here the images are loaded fine...
  • where you see the pink dots the images are not loaded
  • where you see the black dot.. 5 boxes in the red section... they are javascript rollover images well they loaded but are not working.. once mouse over the rollover image is not displayed
  • on the top right where you see the yellow boxes.. the links and the textbox and the button have css style attached which is not working...

WHATS HAPPENING

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

你的往事 2024-09-23 02:36:20

这样的链接

我有像href=".\images\image.png"

,只是将它们更改为

href=".\images/image.png"

服务器正在做什么它本来应该做...

i had my links like

href=".\images\image.png"

just changed them to

href=".\images/image.png"

the server was doing what it was supposed to do...

遥远的绿洲 2024-09-23 02:36:19

也许您的资源(css 和 js)服务不正确?

如果您在 Firefox 中查看页面源代码,您将能够单击 css 链接。这样做,看看它是否会带你到你的 css。如果没有,那么你就有了答案 - 资产路径错误。

Perhaps your assets (css and js) are served incorrectly?

If you view source of you page in Firefox, you will be able to click on css link. Do it and see if it take you to your css. If not, then you have the answer - assets path is wrong.

独夜无伴 2024-09-23 02:36:19

看起来图像放错了地方。

WAMP 默认指向 C:\www。如果 CSS/HTML 中的图像被“/images/example.png”引用,那么 Apache 会将此请求解释为:

“在文件夹 C:\www\images\ 中查找文件 example.png”,

您需要将目录“/myFolder/images/”添加到图像 URL 或引用 CSS 文件中的相关图像。

这意味着如果您的 css 文件位于 C:\www\myFolder 中,并且 C:\www\myFolder 中有一个图像文件夹,那么 css 中的图像将如下声明:

url('images/example.png');

请注意,尾部斜杠已被删除,这意味着它将是相对于 CSS 而不是相对于根目录 (C:\www)

希望有帮助。

It looks like the images are in the wrong place.

WAMP by default points to C:\www. If your images in your CSS/HTML are referenced by "/images/example.png", then Apache interprets this request as:

"Look for the file example.png in the folder C:\www\images\"

You need to either add the directory "/myFolder/images/" to the image URL or reference the images relative from the CSS file.

This means if your css file is in your C:\www\myFolder and you have an images folder in C:\www\myFolder then your images inside your css will be declared like this:

url('images/example.png');

Note that the trailing slash has been removed, this means it will be relative from the CSS rather than from the root directory (C:\www)

Hope that helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文